@timardex/cluemart-shared 1.2.32 → 1.2.34
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-Cv1V8lgJ.d.ts → ad-BZylIpez.d.ts} +1 -1
- package/dist/{ad-IVwm5MLY.d.mts → ad-CiYcsJB7.d.mts} +1 -1
- package/dist/{auth-BCxQp_CF.d.ts → auth-CmaB99NK.d.ts} +1 -1
- package/dist/{auth-BczaOu28.d.mts → auth-DDtMJHZw.d.mts} +1 -1
- package/dist/formFields/index.cjs +0 -7
- package/dist/formFields/index.cjs.map +1 -1
- package/dist/formFields/index.d.mts +1 -1
- package/dist/formFields/index.d.ts +1 -1
- package/dist/formFields/index.mjs +0 -7
- package/dist/formFields/index.mjs.map +1 -1
- package/dist/{global-Bnr6l_NH.d.ts → global-DVYSZ6LR.d.ts} +4 -4
- package/dist/{global-_89-F0iL.d.mts → global-ExJZRDGR.d.mts} +4 -4
- package/dist/graphql/index.d.mts +2 -2
- package/dist/graphql/index.d.ts +2 -2
- package/dist/hooks/index.cjs +1 -0
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.mts +3 -3
- package/dist/hooks/index.d.ts +3 -3
- package/dist/hooks/index.mjs +1 -0
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.cjs +13 -48
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +6 -13
- package/dist/index.d.ts +6 -13
- package/dist/index.mjs +11 -45
- package/dist/index.mjs.map +1 -1
- package/dist/mongoose/index.cjs.map +1 -1
- package/dist/mongoose/index.d.mts +3 -3
- package/dist/mongoose/index.d.ts +3 -3
- package/dist/mongoose/index.mjs +4 -4
- package/dist/mongoose/index.mjs.map +1 -1
- package/dist/service/index.cjs +17 -49
- package/dist/service/index.cjs.map +1 -1
- package/dist/service/index.d.mts +4 -11
- package/dist/service/index.d.ts +4 -11
- package/dist/service/index.mjs +10 -40
- package/dist/service/index.mjs.map +1 -1
- package/dist/types/index.d.mts +3 -3
- package/dist/types/index.d.ts +3 -3
- package/dist/utils/index.d.mts +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -280,11 +280,11 @@ type NotificationCount = {
|
|
|
280
280
|
unread: number;
|
|
281
281
|
};
|
|
282
282
|
type CreateBulkNotificationInput = {
|
|
283
|
-
|
|
284
|
-
title: string;
|
|
283
|
+
data: NotificationDataType | null;
|
|
285
284
|
message: string;
|
|
285
|
+
title: string;
|
|
286
286
|
type: EnumNotificationType;
|
|
287
|
-
|
|
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
|
|
1902
|
+
declare function saveNotificationsInDb(payload: SchemaCreateBulkNotificationInput): Promise<ObjectId[]>;
|
|
1904
1903
|
|
|
1905
|
-
|
|
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,
|
|
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
|
-
|
|
284
|
-
title: string;
|
|
283
|
+
data: NotificationDataType | null;
|
|
285
284
|
message: string;
|
|
285
|
+
title: string;
|
|
286
286
|
type: EnumNotificationType;
|
|
287
|
-
|
|
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
|
|
1902
|
+
declare function saveNotificationsInDb(payload: SchemaCreateBulkNotificationInput): Promise<ObjectId[]>;
|
|
1904
1903
|
|
|
1905
|
-
|
|
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,
|
|
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
|
@@ -926,13 +926,6 @@ var validateVerificationTokenFields = [
|
|
|
926
926
|
|
|
927
927
|
// src/formFields/user.ts
|
|
928
928
|
var profileFields = [
|
|
929
|
-
{
|
|
930
|
-
disabled: true,
|
|
931
|
-
helperText: "Email cannot be changed",
|
|
932
|
-
keyboardType: "email-address",
|
|
933
|
-
name: "email",
|
|
934
|
-
placeholder: "Email"
|
|
935
|
-
},
|
|
936
929
|
{
|
|
937
930
|
...emailField,
|
|
938
931
|
disabled: true,
|
|
@@ -4913,6 +4906,7 @@ var testersSchema = yup6.object().shape({
|
|
|
4913
4906
|
categories: yup6.array().nullable().when("resourceType", {
|
|
4914
4907
|
is: "vendor" /* VENDOR */,
|
|
4915
4908
|
then: () => categorySchema.min(1, "Category list must contain at least one item").required("Categories required"),
|
|
4909
|
+
// eslint-disable-next-line sort-keys
|
|
4916
4910
|
otherwise: () => yup6.array().nullable().notRequired()
|
|
4917
4911
|
}),
|
|
4918
4912
|
companyName: yup6.string().required("Company name is required"),
|
|
@@ -6863,32 +6857,8 @@ var connectToDatabase = async ({
|
|
|
6863
6857
|
}
|
|
6864
6858
|
};
|
|
6865
6859
|
|
|
6866
|
-
// src/service/
|
|
6867
|
-
async function
|
|
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) {
|
|
6860
|
+
// src/service/saveNotificationsInDb.ts
|
|
6861
|
+
async function saveNotificationsInDb(payload) {
|
|
6892
6862
|
const { data, message, title, type, userIds } = payload;
|
|
6893
6863
|
try {
|
|
6894
6864
|
const notifications = userIds.map((userId) => ({
|
|
@@ -6899,22 +6869,18 @@ async function createNotifications(payload, context) {
|
|
|
6899
6869
|
type,
|
|
6900
6870
|
userId
|
|
6901
6871
|
}));
|
|
6902
|
-
|
|
6872
|
+
await NotificationModel.insertMany(notifications);
|
|
6903
6873
|
console.log(
|
|
6904
|
-
`Created ${
|
|
6874
|
+
`Created ${notifications.length} notifications for ${userIds.length} users`
|
|
6905
6875
|
);
|
|
6906
|
-
|
|
6907
|
-
for (const userId of uniqueUserIds) {
|
|
6908
|
-
await publishNotificationEvents(userId, context);
|
|
6909
|
-
}
|
|
6910
|
-
return savedNotifications;
|
|
6876
|
+
return [...new Set(userIds)];
|
|
6911
6877
|
} catch (error) {
|
|
6912
6878
|
console.error("Failed to create notifications:", error);
|
|
6913
6879
|
return [];
|
|
6914
6880
|
}
|
|
6915
6881
|
}
|
|
6916
6882
|
|
|
6917
|
-
// src/service/
|
|
6883
|
+
// src/service/sendPushNotifications.ts
|
|
6918
6884
|
import { Expo } from "expo-server-sdk";
|
|
6919
6885
|
var expo = new Expo();
|
|
6920
6886
|
function extractTokensFromMessage(message) {
|
|
@@ -6982,7 +6948,7 @@ async function sendChunk(chunk, chunkIndex) {
|
|
|
6982
6948
|
return { failedTokens: [], successCount: 0 };
|
|
6983
6949
|
}
|
|
6984
6950
|
}
|
|
6985
|
-
async function
|
|
6951
|
+
async function sendPushNotifications({
|
|
6986
6952
|
data,
|
|
6987
6953
|
message,
|
|
6988
6954
|
title,
|
|
@@ -6990,6 +6956,7 @@ async function sendPushNotification({
|
|
|
6990
6956
|
}) {
|
|
6991
6957
|
const pushTokens = await PushTokenModel.find({ userId: { $in: userIds } });
|
|
6992
6958
|
const expoTokens = pushTokens.map((token) => token.token);
|
|
6959
|
+
if (!data) return;
|
|
6993
6960
|
const { messages, invalidTokens } = createPushMessages({
|
|
6994
6961
|
data,
|
|
6995
6962
|
message,
|
|
@@ -7124,7 +7091,6 @@ export {
|
|
|
7124
7091
|
companyContactFields,
|
|
7125
7092
|
connectToDatabase,
|
|
7126
7093
|
contactUsFields,
|
|
7127
|
-
createNotifications,
|
|
7128
7094
|
darkColors,
|
|
7129
7095
|
dateFormat,
|
|
7130
7096
|
defaultEventFormValues,
|
|
@@ -7157,14 +7123,14 @@ export {
|
|
|
7157
7123
|
producedIngOptions,
|
|
7158
7124
|
productLabelGroups,
|
|
7159
7125
|
profileFields,
|
|
7160
|
-
publishNotificationEvents,
|
|
7161
7126
|
registerFields,
|
|
7162
7127
|
relationDatesSchema,
|
|
7163
7128
|
removeTypename,
|
|
7164
7129
|
requestPasswordResetFields,
|
|
7165
7130
|
requirementsOptions,
|
|
7166
7131
|
resetPasswordFields,
|
|
7167
|
-
|
|
7132
|
+
saveNotificationsInDb,
|
|
7133
|
+
sendPushNotifications,
|
|
7168
7134
|
socialMediaFields,
|
|
7169
7135
|
sortDatesChronologically,
|
|
7170
7136
|
stallTypeOptions,
|