@timardex/cluemart-shared 1.2.32 → 1.2.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -280,11 +280,11 @@ type NotificationCount = {
280
280
  unread: number;
281
281
  };
282
282
  type CreateBulkNotificationInput = {
283
- userIds: string[];
284
- title: string;
283
+ data: NotificationDataType | null;
285
284
  message: string;
285
+ title: string;
286
286
  type: EnumNotificationType;
287
- data: NotificationDataType | null;
287
+ userIds: string[];
288
288
  };
289
289
 
290
290
  interface PosterInputType {
@@ -1895,20 +1895,13 @@ declare const connectToDatabase: ({ appName, dbName, dbPassword, dbUser, mongodb
1895
1895
  mongodbUri: string;
1896
1896
  }) => Promise<void>;
1897
1897
 
1898
- declare function publishNotificationEvents(userId: ObjectId, context: GraphQLContext): Promise<void>;
1899
1898
  /**
1900
1899
  * Create notifications in the database for multiple users
1901
1900
  * This is typically called when sending push notifications
1902
1901
  */
1903
- declare function createNotifications(payload: SchemaCreateBulkNotificationInput, context: GraphQLContext): Promise<SchemaNotificationType[]>;
1902
+ declare function saveNotificationsInDb(payload: SchemaCreateBulkNotificationInput): Promise<ObjectId[]>;
1904
1903
 
1905
- interface SendPushNotificationOptions {
1906
- data: NotificationDataType;
1907
- message: string;
1908
- title: string;
1909
- userIds: ObjectId[];
1910
- }
1911
- declare function sendPushNotification({ data, message, title, userIds, }: SendPushNotificationOptions): Promise<void>;
1904
+ declare function sendPushNotifications({ data, message, title, userIds, }: SchemaCreateBulkNotificationInput): Promise<void>;
1912
1905
 
1913
1906
  declare const SAVED_PASSWORD_KEY = "savedPassword";
1914
1907
  declare const SAVED_EMAIL_KEY = "savedEmail";
@@ -2012,4 +2005,4 @@ declare const availableRegionOptions: OptionItem[];
2012
2005
  declare const paymentMethodOptions: OptionItem[];
2013
2006
  declare function normalizeUrl(url: string): string;
2014
2007
 
2015
- export { type AdFormData, AdModel, type AdType, type AdminUpdateResourceType, type AuthUser, type BaseResourceType, type BaseResourceTypeFormData, type Category, CategorySchema, type ChatMessageInput, type ChatMessageType, ChatModel, type ChatType, type ContactUsFormData, type CreateAdFormData, type CreateBulkNotificationInput, type CreateContactUsFormData, type CreateEventFormData, type CreateEventInfoFormData, type CreateFormData, type CreateLoginFormData, type CreateRegisterFormData, type CreateRequestPasswordResetFormData, type CreateResetPasswordFormData, type CreateTestersFormData, type CreateUserFormData, type CreateValidateVerificationTokenFormData, type CreateVendorFormData, type CreateVendorInfoFormData, type DateTimeType, type DateTimeWithPriceType, type DeviceInfo, EnumActivity, EnumAdShowOn, EnumAdStatus, EnumAdStyle, EnumAdType, EnumChatType, EnumEventType, EnumFoodFlavor, EnumInviteStatus, EnumNotificationResourceType, EnumNotificationType, EnumOSPlatform, EnumPaymentMethod, EnumPubSubEvents, EnumRegions, EnumRelationResource, EnumResourceType, EnumSocialMedia, EnumUserLicence, EnumUserRole, EnumVendorType, type EventFormData, type EventInfoFormData, EventInfoModel, type EventInfoType, EventModel, type EventType, type FormDateField, type FormField, type GeocodeLocation, type GraphQLContext, type ImageObjectType, ImageTypeEnum, type LocationType, type LoginFormData, type MapMultiLocation, type NotificationCount, type NotificationDataType, NotificationModel, type NotificationType, type Nullable, type ObjectId, type OptionItem, type OwnerType, ParticipantSchema, type ParticipantType, type PartnerType, type PaymentInfoType, type PlacePrediction, type PosterInputType, type PosterUsageType, PushTokenModel, type Region, type RegisterFormData, type RelationDate, RelationModel, type RelationType, RelationTypeSchema, type RequestPasswordResetFormData, type Requirement, type ResetPasswordFormData, type ResourceActivityEntry, type ResourceActivityInputType, ResourceActivityModel, type ResourceActivityType, type ResourceConnectionsType, type ResourceContactDetailsType, type ResourceImageType, ResourceImageTypeSchema, SAVED_EMAIL_KEY, SAVED_PASSWORD_KEY, SAVED_REFRESH_TOKEN_KEY, SAVED_TOKEN_KEY, type SchemaChatMessageType, type SchemaChatType, type SchemaCreateBulkNotificationInput, type SchemaEventInfoType, type SchemaEventType, type SchemaNotificationType, type SchemaOwnerType, type SchemaParticipantType, type SchemaPushTokenType, type SchemaRelationType, type SchemaUserActivityEvent, type SchemaUserType, type SchemaVendorInfoType, type SchemaVendorType, type SocialMediaType, SocialMediaTypeSchema, type StallType, StallTypeSchema, type Subcategory, type SubcategoryItems, type SubscriptionPayload, type TermsAgreement, TesterModel, type TesterType, type TestersFormData, USER_STORAGE_KEY, type UserActivity, type UserActivityEvent, type UserFormData, UserModel, type UserType, type ValidateVerificationTokenFormData, type VendorAttributes, type VendorFormData, type VendorInfoFormData, VendorInfoModel, type VendorInfoType, type VendorLocation, type VendorMenuType, VendorModel, type VendorType, VerificationTokenModel, type VerificationTokenType, availableCategories, availableCityOptions, availableRegionOptions, availableRegionTypes, availableTagTypes, baseResourceFields, capitalizeFirstLetter, categoryColors, companyContactFields, connectToDatabase, contactUsFields, createNotifications, darkColors, dateFormat, defaultEventFormValues, defaultEventInfoFormValues, defaultRegion, defaultVendorFormValues, defaultVendorInfoFormValues, emailField, eventBasicInfoFields, eventEndDateFields, eventInfo, eventInfoPaymentInfo, eventStartDateFields, fonts, foodFlavourOptions, formatDate, formatTimestamp, getCurrentAndFutureDates, globalDefaultValues, isFutureDatesBeforeThreshold, lightColors, loginFields, mapArrayToOptions, mapBaseResourceTypeToFormData, normalizeUrl, packagingOptions, partnersSchema, paymentMethodOptions, producedIngOptions, productLabelGroups, profileFields, publishNotificationEvents, registerFields, relationDatesSchema, removeTypename, requestPasswordResetFields, requirementsOptions, resetPasswordFields, sendPushNotification, socialMediaFields, sortDatesChronologically, stallTypeOptions, statusOptions, tagOptions, termsAgreementSchema, testersFields, timeFormat, truncateText, useAdForm, useAddParticipantToChat, useAddUserFavouriteResource, useAddUserGoingResource, useAddUserInterestResource, useAddUserPresentResource, useAdminUpdateResourceType, useContactUs, useContactUsForm, useCreateAd, useCreateBulkNotifications, useCreateEvent, useCreateEventInfo, useCreatePoster, useCreatePushToken, useCreateRelation, useCreateResourceActivity, useCreateTester, useCreateUser, useCreateVendor, useCreateVendorInfo, useDeleteAd, useDeleteAllNotifications, useDeleteChat, useDeleteEvent, useDeleteNotification, useDeleteRelation, useDeleteTester, useDeleteUser, useDeleteVendor, useEventForm, useEventInfoForm, useGetAd, useGetAds, useGetAdsByRegion, useGetChat, useGetChatSubscription, useGetEvent, useGetEventInfo, useGetEventRelations, useGetEvents, useGetEventsByRegion, useGetEventsNearMe, useGetNotificationCount, useGetNotificationCountSubscription, useGetRelation, useGetRelationByEventAndVendor, useGetResourceActivities, useGetResourceConnections, useGetTester, useGetTesters, useGetUser, useGetUserActivities, useGetUserChats, useGetUserEvents, useGetUserNotifications, useGetUserNotificationsSubscription, useGetUserVendors, useGetUsers, useGetVendor, useGetVendorInfo, useGetVendorRelations, useGetVendors, useGetVendorsByRegion, useLocationSearch, useLogin, useLoginForm, useLogout, useMarkAllNotificationsRead, useMarkNotificationRead, useRefreshToken, useRegister, useRegisterForm, useRemoveParticipantFromChat, useRemoveUserFavouriteResource, useRemoveUserGoingResource, useRemoveUserInterestResource, useRemoveUserPresentResource, useRequestPasswordReset, useRequestPasswordResetForm, useResetPassword, useResetPasswordForm, useSearchEvents, useSearchVendors, useSelectPackage, useSendChatMessage, useTestersForm, useUpdateAd, useUpdateEvent, useUpdateEventInfo, useUpdateRelation, useUpdateTester, useUpdateUser, useUpdateVendor, useUpdateVendorInfo, useUserForm, useValidateVerificationToken, useValidateVerificationTokenForm, useVendorForm, useVendorInfoForm, validateVerificationTokenFields, vendorAvailability, vendorBasicInfoFields, vendorCompliance, vendorElectricity, vendorEndDateFields, vendorFoodFlavour, vendorFullAddress, vendorGazebo, vendorLocationDescription, vendorMenuFields, vendorMultiLocation, vendorPackaging, vendorPriceRange, vendorProducedIn, vendorStallSize, vendorStartDateFields, vendorTable };
2008
+ export { type AdFormData, AdModel, type AdType, type AdminUpdateResourceType, type AuthUser, type BaseResourceType, type BaseResourceTypeFormData, type Category, CategorySchema, type ChatMessageInput, type ChatMessageType, ChatModel, type ChatType, type ContactUsFormData, type CreateAdFormData, type CreateBulkNotificationInput, type CreateContactUsFormData, type CreateEventFormData, type CreateEventInfoFormData, type CreateFormData, type CreateLoginFormData, type CreateRegisterFormData, type CreateRequestPasswordResetFormData, type CreateResetPasswordFormData, type CreateTestersFormData, type CreateUserFormData, type CreateValidateVerificationTokenFormData, type CreateVendorFormData, type CreateVendorInfoFormData, type DateTimeType, type DateTimeWithPriceType, type DeviceInfo, EnumActivity, EnumAdShowOn, EnumAdStatus, EnumAdStyle, EnumAdType, EnumChatType, EnumEventType, EnumFoodFlavor, EnumInviteStatus, EnumNotificationResourceType, EnumNotificationType, EnumOSPlatform, EnumPaymentMethod, EnumPubSubEvents, EnumRegions, EnumRelationResource, EnumResourceType, EnumSocialMedia, EnumUserLicence, EnumUserRole, EnumVendorType, type EventFormData, type EventInfoFormData, EventInfoModel, type EventInfoType, EventModel, type EventType, type FormDateField, type FormField, type GeocodeLocation, type GraphQLContext, type ImageObjectType, ImageTypeEnum, type LocationType, type LoginFormData, type MapMultiLocation, type NotificationCount, type NotificationDataType, NotificationModel, type NotificationType, type Nullable, type ObjectId, type OptionItem, type OwnerType, ParticipantSchema, type ParticipantType, type PartnerType, type PaymentInfoType, type PlacePrediction, type PosterInputType, type PosterUsageType, PushTokenModel, type Region, type RegisterFormData, type RelationDate, RelationModel, type RelationType, RelationTypeSchema, type RequestPasswordResetFormData, type Requirement, type ResetPasswordFormData, type ResourceActivityEntry, type ResourceActivityInputType, ResourceActivityModel, type ResourceActivityType, type ResourceConnectionsType, type ResourceContactDetailsType, type ResourceImageType, ResourceImageTypeSchema, SAVED_EMAIL_KEY, SAVED_PASSWORD_KEY, SAVED_REFRESH_TOKEN_KEY, SAVED_TOKEN_KEY, type SchemaChatMessageType, type SchemaChatType, type SchemaCreateBulkNotificationInput, type SchemaEventInfoType, type SchemaEventType, type SchemaNotificationType, type SchemaOwnerType, type SchemaParticipantType, type SchemaPushTokenType, type SchemaRelationType, type SchemaUserActivityEvent, type SchemaUserType, type SchemaVendorInfoType, type SchemaVendorType, type SocialMediaType, SocialMediaTypeSchema, type StallType, StallTypeSchema, type Subcategory, type SubcategoryItems, type SubscriptionPayload, type TermsAgreement, TesterModel, type TesterType, type TestersFormData, USER_STORAGE_KEY, type UserActivity, type UserActivityEvent, type UserFormData, UserModel, type UserType, type ValidateVerificationTokenFormData, type VendorAttributes, type VendorFormData, type VendorInfoFormData, VendorInfoModel, type VendorInfoType, type VendorLocation, type VendorMenuType, VendorModel, type VendorType, VerificationTokenModel, type VerificationTokenType, availableCategories, availableCityOptions, availableRegionOptions, availableRegionTypes, availableTagTypes, baseResourceFields, capitalizeFirstLetter, categoryColors, companyContactFields, connectToDatabase, contactUsFields, darkColors, dateFormat, defaultEventFormValues, defaultEventInfoFormValues, defaultRegion, defaultVendorFormValues, defaultVendorInfoFormValues, emailField, eventBasicInfoFields, eventEndDateFields, eventInfo, eventInfoPaymentInfo, eventStartDateFields, fonts, foodFlavourOptions, formatDate, formatTimestamp, getCurrentAndFutureDates, globalDefaultValues, isFutureDatesBeforeThreshold, lightColors, loginFields, mapArrayToOptions, mapBaseResourceTypeToFormData, normalizeUrl, packagingOptions, partnersSchema, paymentMethodOptions, producedIngOptions, productLabelGroups, profileFields, registerFields, relationDatesSchema, removeTypename, requestPasswordResetFields, requirementsOptions, resetPasswordFields, saveNotificationsInDb, sendPushNotifications, socialMediaFields, sortDatesChronologically, stallTypeOptions, statusOptions, tagOptions, termsAgreementSchema, testersFields, timeFormat, truncateText, useAdForm, useAddParticipantToChat, useAddUserFavouriteResource, useAddUserGoingResource, useAddUserInterestResource, useAddUserPresentResource, useAdminUpdateResourceType, useContactUs, useContactUsForm, useCreateAd, useCreateBulkNotifications, useCreateEvent, useCreateEventInfo, useCreatePoster, useCreatePushToken, useCreateRelation, useCreateResourceActivity, useCreateTester, useCreateUser, useCreateVendor, useCreateVendorInfo, useDeleteAd, useDeleteAllNotifications, useDeleteChat, useDeleteEvent, useDeleteNotification, useDeleteRelation, useDeleteTester, useDeleteUser, useDeleteVendor, useEventForm, useEventInfoForm, useGetAd, useGetAds, useGetAdsByRegion, useGetChat, useGetChatSubscription, useGetEvent, useGetEventInfo, useGetEventRelations, useGetEvents, useGetEventsByRegion, useGetEventsNearMe, useGetNotificationCount, useGetNotificationCountSubscription, useGetRelation, useGetRelationByEventAndVendor, useGetResourceActivities, useGetResourceConnections, useGetTester, useGetTesters, useGetUser, useGetUserActivities, useGetUserChats, useGetUserEvents, useGetUserNotifications, useGetUserNotificationsSubscription, useGetUserVendors, useGetUsers, useGetVendor, useGetVendorInfo, useGetVendorRelations, useGetVendors, useGetVendorsByRegion, useLocationSearch, useLogin, useLoginForm, useLogout, useMarkAllNotificationsRead, useMarkNotificationRead, useRefreshToken, useRegister, useRegisterForm, useRemoveParticipantFromChat, useRemoveUserFavouriteResource, useRemoveUserGoingResource, useRemoveUserInterestResource, useRemoveUserPresentResource, useRequestPasswordReset, useRequestPasswordResetForm, useResetPassword, useResetPasswordForm, useSearchEvents, useSearchVendors, useSelectPackage, useSendChatMessage, useTestersForm, useUpdateAd, useUpdateEvent, useUpdateEventInfo, useUpdateRelation, useUpdateTester, useUpdateUser, useUpdateVendor, useUpdateVendorInfo, useUserForm, useValidateVerificationToken, useValidateVerificationTokenForm, useVendorForm, useVendorInfoForm, validateVerificationTokenFields, vendorAvailability, vendorBasicInfoFields, vendorCompliance, vendorElectricity, vendorEndDateFields, vendorFoodFlavour, vendorFullAddress, vendorGazebo, vendorLocationDescription, vendorMenuFields, vendorMultiLocation, vendorPackaging, vendorPriceRange, vendorProducedIn, vendorStallSize, vendorStartDateFields, vendorTable };
package/dist/index.d.ts CHANGED
@@ -280,11 +280,11 @@ type NotificationCount = {
280
280
  unread: number;
281
281
  };
282
282
  type CreateBulkNotificationInput = {
283
- userIds: string[];
284
- title: string;
283
+ data: NotificationDataType | null;
285
284
  message: string;
285
+ title: string;
286
286
  type: EnumNotificationType;
287
- data: NotificationDataType | null;
287
+ userIds: string[];
288
288
  };
289
289
 
290
290
  interface PosterInputType {
@@ -1895,20 +1895,13 @@ declare const connectToDatabase: ({ appName, dbName, dbPassword, dbUser, mongodb
1895
1895
  mongodbUri: string;
1896
1896
  }) => Promise<void>;
1897
1897
 
1898
- declare function publishNotificationEvents(userId: ObjectId, context: GraphQLContext): Promise<void>;
1899
1898
  /**
1900
1899
  * Create notifications in the database for multiple users
1901
1900
  * This is typically called when sending push notifications
1902
1901
  */
1903
- declare function createNotifications(payload: SchemaCreateBulkNotificationInput, context: GraphQLContext): Promise<SchemaNotificationType[]>;
1902
+ declare function saveNotificationsInDb(payload: SchemaCreateBulkNotificationInput): Promise<ObjectId[]>;
1904
1903
 
1905
- interface SendPushNotificationOptions {
1906
- data: NotificationDataType;
1907
- message: string;
1908
- title: string;
1909
- userIds: ObjectId[];
1910
- }
1911
- declare function sendPushNotification({ data, message, title, userIds, }: SendPushNotificationOptions): Promise<void>;
1904
+ declare function sendPushNotifications({ data, message, title, userIds, }: SchemaCreateBulkNotificationInput): Promise<void>;
1912
1905
 
1913
1906
  declare const SAVED_PASSWORD_KEY = "savedPassword";
1914
1907
  declare const SAVED_EMAIL_KEY = "savedEmail";
@@ -2012,4 +2005,4 @@ declare const availableRegionOptions: OptionItem[];
2012
2005
  declare const paymentMethodOptions: OptionItem[];
2013
2006
  declare function normalizeUrl(url: string): string;
2014
2007
 
2015
- export { type AdFormData, AdModel, type AdType, type AdminUpdateResourceType, type AuthUser, type BaseResourceType, type BaseResourceTypeFormData, type Category, CategorySchema, type ChatMessageInput, type ChatMessageType, ChatModel, type ChatType, type ContactUsFormData, type CreateAdFormData, type CreateBulkNotificationInput, type CreateContactUsFormData, type CreateEventFormData, type CreateEventInfoFormData, type CreateFormData, type CreateLoginFormData, type CreateRegisterFormData, type CreateRequestPasswordResetFormData, type CreateResetPasswordFormData, type CreateTestersFormData, type CreateUserFormData, type CreateValidateVerificationTokenFormData, type CreateVendorFormData, type CreateVendorInfoFormData, type DateTimeType, type DateTimeWithPriceType, type DeviceInfo, EnumActivity, EnumAdShowOn, EnumAdStatus, EnumAdStyle, EnumAdType, EnumChatType, EnumEventType, EnumFoodFlavor, EnumInviteStatus, EnumNotificationResourceType, EnumNotificationType, EnumOSPlatform, EnumPaymentMethod, EnumPubSubEvents, EnumRegions, EnumRelationResource, EnumResourceType, EnumSocialMedia, EnumUserLicence, EnumUserRole, EnumVendorType, type EventFormData, type EventInfoFormData, EventInfoModel, type EventInfoType, EventModel, type EventType, type FormDateField, type FormField, type GeocodeLocation, type GraphQLContext, type ImageObjectType, ImageTypeEnum, type LocationType, type LoginFormData, type MapMultiLocation, type NotificationCount, type NotificationDataType, NotificationModel, type NotificationType, type Nullable, type ObjectId, type OptionItem, type OwnerType, ParticipantSchema, type ParticipantType, type PartnerType, type PaymentInfoType, type PlacePrediction, type PosterInputType, type PosterUsageType, PushTokenModel, type Region, type RegisterFormData, type RelationDate, RelationModel, type RelationType, RelationTypeSchema, type RequestPasswordResetFormData, type Requirement, type ResetPasswordFormData, type ResourceActivityEntry, type ResourceActivityInputType, ResourceActivityModel, type ResourceActivityType, type ResourceConnectionsType, type ResourceContactDetailsType, type ResourceImageType, ResourceImageTypeSchema, SAVED_EMAIL_KEY, SAVED_PASSWORD_KEY, SAVED_REFRESH_TOKEN_KEY, SAVED_TOKEN_KEY, type SchemaChatMessageType, type SchemaChatType, type SchemaCreateBulkNotificationInput, type SchemaEventInfoType, type SchemaEventType, type SchemaNotificationType, type SchemaOwnerType, type SchemaParticipantType, type SchemaPushTokenType, type SchemaRelationType, type SchemaUserActivityEvent, type SchemaUserType, type SchemaVendorInfoType, type SchemaVendorType, type SocialMediaType, SocialMediaTypeSchema, type StallType, StallTypeSchema, type Subcategory, type SubcategoryItems, type SubscriptionPayload, type TermsAgreement, TesterModel, type TesterType, type TestersFormData, USER_STORAGE_KEY, type UserActivity, type UserActivityEvent, type UserFormData, UserModel, type UserType, type ValidateVerificationTokenFormData, type VendorAttributes, type VendorFormData, type VendorInfoFormData, VendorInfoModel, type VendorInfoType, type VendorLocation, type VendorMenuType, VendorModel, type VendorType, VerificationTokenModel, type VerificationTokenType, availableCategories, availableCityOptions, availableRegionOptions, availableRegionTypes, availableTagTypes, baseResourceFields, capitalizeFirstLetter, categoryColors, companyContactFields, connectToDatabase, contactUsFields, createNotifications, darkColors, dateFormat, defaultEventFormValues, defaultEventInfoFormValues, defaultRegion, defaultVendorFormValues, defaultVendorInfoFormValues, emailField, eventBasicInfoFields, eventEndDateFields, eventInfo, eventInfoPaymentInfo, eventStartDateFields, fonts, foodFlavourOptions, formatDate, formatTimestamp, getCurrentAndFutureDates, globalDefaultValues, isFutureDatesBeforeThreshold, lightColors, loginFields, mapArrayToOptions, mapBaseResourceTypeToFormData, normalizeUrl, packagingOptions, partnersSchema, paymentMethodOptions, producedIngOptions, productLabelGroups, profileFields, publishNotificationEvents, registerFields, relationDatesSchema, removeTypename, requestPasswordResetFields, requirementsOptions, resetPasswordFields, sendPushNotification, socialMediaFields, sortDatesChronologically, stallTypeOptions, statusOptions, tagOptions, termsAgreementSchema, testersFields, timeFormat, truncateText, useAdForm, useAddParticipantToChat, useAddUserFavouriteResource, useAddUserGoingResource, useAddUserInterestResource, useAddUserPresentResource, useAdminUpdateResourceType, useContactUs, useContactUsForm, useCreateAd, useCreateBulkNotifications, useCreateEvent, useCreateEventInfo, useCreatePoster, useCreatePushToken, useCreateRelation, useCreateResourceActivity, useCreateTester, useCreateUser, useCreateVendor, useCreateVendorInfo, useDeleteAd, useDeleteAllNotifications, useDeleteChat, useDeleteEvent, useDeleteNotification, useDeleteRelation, useDeleteTester, useDeleteUser, useDeleteVendor, useEventForm, useEventInfoForm, useGetAd, useGetAds, useGetAdsByRegion, useGetChat, useGetChatSubscription, useGetEvent, useGetEventInfo, useGetEventRelations, useGetEvents, useGetEventsByRegion, useGetEventsNearMe, useGetNotificationCount, useGetNotificationCountSubscription, useGetRelation, useGetRelationByEventAndVendor, useGetResourceActivities, useGetResourceConnections, useGetTester, useGetTesters, useGetUser, useGetUserActivities, useGetUserChats, useGetUserEvents, useGetUserNotifications, useGetUserNotificationsSubscription, useGetUserVendors, useGetUsers, useGetVendor, useGetVendorInfo, useGetVendorRelations, useGetVendors, useGetVendorsByRegion, useLocationSearch, useLogin, useLoginForm, useLogout, useMarkAllNotificationsRead, useMarkNotificationRead, useRefreshToken, useRegister, useRegisterForm, useRemoveParticipantFromChat, useRemoveUserFavouriteResource, useRemoveUserGoingResource, useRemoveUserInterestResource, useRemoveUserPresentResource, useRequestPasswordReset, useRequestPasswordResetForm, useResetPassword, useResetPasswordForm, useSearchEvents, useSearchVendors, useSelectPackage, useSendChatMessage, useTestersForm, useUpdateAd, useUpdateEvent, useUpdateEventInfo, useUpdateRelation, useUpdateTester, useUpdateUser, useUpdateVendor, useUpdateVendorInfo, useUserForm, useValidateVerificationToken, useValidateVerificationTokenForm, useVendorForm, useVendorInfoForm, validateVerificationTokenFields, vendorAvailability, vendorBasicInfoFields, vendorCompliance, vendorElectricity, vendorEndDateFields, vendorFoodFlavour, vendorFullAddress, vendorGazebo, vendorLocationDescription, vendorMenuFields, vendorMultiLocation, vendorPackaging, vendorPriceRange, vendorProducedIn, vendorStallSize, vendorStartDateFields, vendorTable };
2008
+ export { type AdFormData, AdModel, type AdType, type AdminUpdateResourceType, type AuthUser, type BaseResourceType, type BaseResourceTypeFormData, type Category, CategorySchema, type ChatMessageInput, type ChatMessageType, ChatModel, type ChatType, type ContactUsFormData, type CreateAdFormData, type CreateBulkNotificationInput, type CreateContactUsFormData, type CreateEventFormData, type CreateEventInfoFormData, type CreateFormData, type CreateLoginFormData, type CreateRegisterFormData, type CreateRequestPasswordResetFormData, type CreateResetPasswordFormData, type CreateTestersFormData, type CreateUserFormData, type CreateValidateVerificationTokenFormData, type CreateVendorFormData, type CreateVendorInfoFormData, type DateTimeType, type DateTimeWithPriceType, type DeviceInfo, EnumActivity, EnumAdShowOn, EnumAdStatus, EnumAdStyle, EnumAdType, EnumChatType, EnumEventType, EnumFoodFlavor, EnumInviteStatus, EnumNotificationResourceType, EnumNotificationType, EnumOSPlatform, EnumPaymentMethod, EnumPubSubEvents, EnumRegions, EnumRelationResource, EnumResourceType, EnumSocialMedia, EnumUserLicence, EnumUserRole, EnumVendorType, type EventFormData, type EventInfoFormData, EventInfoModel, type EventInfoType, EventModel, type EventType, type FormDateField, type FormField, type GeocodeLocation, type GraphQLContext, type ImageObjectType, ImageTypeEnum, type LocationType, type LoginFormData, type MapMultiLocation, type NotificationCount, type NotificationDataType, NotificationModel, type NotificationType, type Nullable, type ObjectId, type OptionItem, type OwnerType, ParticipantSchema, type ParticipantType, type PartnerType, type PaymentInfoType, type PlacePrediction, type PosterInputType, type PosterUsageType, PushTokenModel, type Region, type RegisterFormData, type RelationDate, RelationModel, type RelationType, RelationTypeSchema, type RequestPasswordResetFormData, type Requirement, type ResetPasswordFormData, type ResourceActivityEntry, type ResourceActivityInputType, ResourceActivityModel, type ResourceActivityType, type ResourceConnectionsType, type ResourceContactDetailsType, type ResourceImageType, ResourceImageTypeSchema, SAVED_EMAIL_KEY, SAVED_PASSWORD_KEY, SAVED_REFRESH_TOKEN_KEY, SAVED_TOKEN_KEY, type SchemaChatMessageType, type SchemaChatType, type SchemaCreateBulkNotificationInput, type SchemaEventInfoType, type SchemaEventType, type SchemaNotificationType, type SchemaOwnerType, type SchemaParticipantType, type SchemaPushTokenType, type SchemaRelationType, type SchemaUserActivityEvent, type SchemaUserType, type SchemaVendorInfoType, type SchemaVendorType, type SocialMediaType, SocialMediaTypeSchema, type StallType, StallTypeSchema, type Subcategory, type SubcategoryItems, type SubscriptionPayload, type TermsAgreement, TesterModel, type TesterType, type TestersFormData, USER_STORAGE_KEY, type UserActivity, type UserActivityEvent, type UserFormData, UserModel, type UserType, type ValidateVerificationTokenFormData, type VendorAttributes, type VendorFormData, type VendorInfoFormData, VendorInfoModel, type VendorInfoType, type VendorLocation, type VendorMenuType, VendorModel, type VendorType, VerificationTokenModel, type VerificationTokenType, availableCategories, availableCityOptions, availableRegionOptions, availableRegionTypes, availableTagTypes, baseResourceFields, capitalizeFirstLetter, categoryColors, companyContactFields, connectToDatabase, contactUsFields, darkColors, dateFormat, defaultEventFormValues, defaultEventInfoFormValues, defaultRegion, defaultVendorFormValues, defaultVendorInfoFormValues, emailField, eventBasicInfoFields, eventEndDateFields, eventInfo, eventInfoPaymentInfo, eventStartDateFields, fonts, foodFlavourOptions, formatDate, formatTimestamp, getCurrentAndFutureDates, globalDefaultValues, isFutureDatesBeforeThreshold, lightColors, loginFields, mapArrayToOptions, mapBaseResourceTypeToFormData, normalizeUrl, packagingOptions, partnersSchema, paymentMethodOptions, producedIngOptions, productLabelGroups, profileFields, registerFields, relationDatesSchema, removeTypename, requestPasswordResetFields, requirementsOptions, resetPasswordFields, saveNotificationsInDb, sendPushNotifications, socialMediaFields, sortDatesChronologically, stallTypeOptions, statusOptions, tagOptions, termsAgreementSchema, testersFields, timeFormat, truncateText, useAdForm, useAddParticipantToChat, useAddUserFavouriteResource, useAddUserGoingResource, useAddUserInterestResource, useAddUserPresentResource, useAdminUpdateResourceType, useContactUs, useContactUsForm, useCreateAd, useCreateBulkNotifications, useCreateEvent, useCreateEventInfo, useCreatePoster, useCreatePushToken, useCreateRelation, useCreateResourceActivity, useCreateTester, useCreateUser, useCreateVendor, useCreateVendorInfo, useDeleteAd, useDeleteAllNotifications, useDeleteChat, useDeleteEvent, useDeleteNotification, useDeleteRelation, useDeleteTester, useDeleteUser, useDeleteVendor, useEventForm, useEventInfoForm, useGetAd, useGetAds, useGetAdsByRegion, useGetChat, useGetChatSubscription, useGetEvent, useGetEventInfo, useGetEventRelations, useGetEvents, useGetEventsByRegion, useGetEventsNearMe, useGetNotificationCount, useGetNotificationCountSubscription, useGetRelation, useGetRelationByEventAndVendor, useGetResourceActivities, useGetResourceConnections, useGetTester, useGetTesters, useGetUser, useGetUserActivities, useGetUserChats, useGetUserEvents, useGetUserNotifications, useGetUserNotificationsSubscription, useGetUserVendors, useGetUsers, useGetVendor, useGetVendorInfo, useGetVendorRelations, useGetVendors, useGetVendorsByRegion, useLocationSearch, useLogin, useLoginForm, useLogout, useMarkAllNotificationsRead, useMarkNotificationRead, useRefreshToken, useRegister, useRegisterForm, useRemoveParticipantFromChat, useRemoveUserFavouriteResource, useRemoveUserGoingResource, useRemoveUserInterestResource, useRemoveUserPresentResource, useRequestPasswordReset, useRequestPasswordResetForm, useResetPassword, useResetPasswordForm, useSearchEvents, useSearchVendors, useSelectPackage, useSendChatMessage, useTestersForm, useUpdateAd, useUpdateEvent, useUpdateEventInfo, useUpdateRelation, useUpdateTester, useUpdateUser, useUpdateVendor, useUpdateVendorInfo, useUserForm, useValidateVerificationToken, useValidateVerificationTokenForm, useVendorForm, useVendorInfoForm, validateVerificationTokenFields, vendorAvailability, vendorBasicInfoFields, vendorCompliance, vendorElectricity, vendorEndDateFields, vendorFoodFlavour, vendorFullAddress, vendorGazebo, vendorLocationDescription, vendorMenuFields, vendorMultiLocation, vendorPackaging, vendorPriceRange, vendorProducedIn, vendorStallSize, vendorStartDateFields, vendorTable };
package/dist/index.mjs CHANGED
@@ -6863,32 +6863,8 @@ var connectToDatabase = async ({
6863
6863
  }
6864
6864
  };
6865
6865
 
6866
- // src/service/notificationService.ts
6867
- async function publishNotificationEvents(userId, context) {
6868
- try {
6869
- const userNotifications = await NotificationModel.find({
6870
- userId
6871
- }).sort({ createdAt: -1 });
6872
- const [total, unread] = await Promise.all([
6873
- NotificationModel.countDocuments({ userId }),
6874
- NotificationModel.countDocuments({ isRead: false, userId })
6875
- ]);
6876
- context.pubsub.publish("GET_NOTIFICATIONS" /* GET_NOTIFICATIONS */, {
6877
- getNotifications: userNotifications,
6878
- getNotificationsUserId: userId
6879
- });
6880
- context.pubsub.publish("GET_NOTIFICATIONS_COUNT" /* GET_NOTIFICATIONS_COUNT */, {
6881
- getNotificationsCount: { total, unread, userId }
6882
- });
6883
- console.log(`Published notification events for user: ${String(userId)}`);
6884
- } catch (error) {
6885
- console.error(
6886
- `Failed to publish notification events for user ${String(userId)}:`,
6887
- error
6888
- );
6889
- }
6890
- }
6891
- async function createNotifications(payload, context) {
6866
+ // src/service/saveNotificationsInDb.ts
6867
+ async function saveNotificationsInDb(payload) {
6892
6868
  const { data, message, title, type, userIds } = payload;
6893
6869
  try {
6894
6870
  const notifications = userIds.map((userId) => ({
@@ -6899,22 +6875,18 @@ async function createNotifications(payload, context) {
6899
6875
  type,
6900
6876
  userId
6901
6877
  }));
6902
- const savedNotifications = await NotificationModel.insertMany(notifications);
6878
+ await NotificationModel.insertMany(notifications);
6903
6879
  console.log(
6904
- `Created ${savedNotifications.length} notifications for ${userIds.length} users`
6880
+ `Created ${notifications.length} notifications for ${userIds.length} users`
6905
6881
  );
6906
- const uniqueUserIds = [...new Set(userIds)];
6907
- for (const userId of uniqueUserIds) {
6908
- await publishNotificationEvents(userId, context);
6909
- }
6910
- return savedNotifications;
6882
+ return [...new Set(userIds)];
6911
6883
  } catch (error) {
6912
6884
  console.error("Failed to create notifications:", error);
6913
6885
  return [];
6914
6886
  }
6915
6887
  }
6916
6888
 
6917
- // src/service/sendPushNotification.ts
6889
+ // src/service/sendPushNotifications.ts
6918
6890
  import { Expo } from "expo-server-sdk";
6919
6891
  var expo = new Expo();
6920
6892
  function extractTokensFromMessage(message) {
@@ -6982,7 +6954,7 @@ async function sendChunk(chunk, chunkIndex) {
6982
6954
  return { failedTokens: [], successCount: 0 };
6983
6955
  }
6984
6956
  }
6985
- async function sendPushNotification({
6957
+ async function sendPushNotifications({
6986
6958
  data,
6987
6959
  message,
6988
6960
  title,
@@ -6990,6 +6962,7 @@ async function sendPushNotification({
6990
6962
  }) {
6991
6963
  const pushTokens = await PushTokenModel.find({ userId: { $in: userIds } });
6992
6964
  const expoTokens = pushTokens.map((token) => token.token);
6965
+ if (!data) return;
6993
6966
  const { messages, invalidTokens } = createPushMessages({
6994
6967
  data,
6995
6968
  message,
@@ -7124,7 +7097,6 @@ export {
7124
7097
  companyContactFields,
7125
7098
  connectToDatabase,
7126
7099
  contactUsFields,
7127
- createNotifications,
7128
7100
  darkColors,
7129
7101
  dateFormat,
7130
7102
  defaultEventFormValues,
@@ -7157,14 +7129,14 @@ export {
7157
7129
  producedIngOptions,
7158
7130
  productLabelGroups,
7159
7131
  profileFields,
7160
- publishNotificationEvents,
7161
7132
  registerFields,
7162
7133
  relationDatesSchema,
7163
7134
  removeTypename,
7164
7135
  requestPasswordResetFields,
7165
7136
  requirementsOptions,
7166
7137
  resetPasswordFields,
7167
- sendPushNotification,
7138
+ saveNotificationsInDb,
7139
+ sendPushNotifications,
7168
7140
  socialMediaFields,
7169
7141
  sortDatesChronologically,
7170
7142
  stallTypeOptions,