@7365admin1/core 3.50.0 → 3.50.1-staging.218

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.
@@ -0,0 +1,5 @@
1
+ ---
2
+ "@7365admin1/core": patch
3
+ ---
4
+
5
+ Constrain site camera `category` and `status` with Joi `.valid()` instead of `.allow()`
package/dist/index.d.ts CHANGED
@@ -4557,6 +4557,12 @@ type TVisitorTransaction = {
4557
4557
  createdBy?: string | ObjectId;
4558
4558
  updatedBy?: string | ObjectId;
4559
4559
  isMembersAdded?: boolean;
4560
+ approval?: {
4561
+ approvedBy?: string | ObjectId;
4562
+ status?: VisitorStatus;
4563
+ remarks?: string;
4564
+ approvedAt?: string | Date;
4565
+ };
4560
4566
  };
4561
4567
  declare const schemaVisitorTransaction: Joi.ObjectSchema<any>;
4562
4568
  /**
@@ -5348,6 +5354,14 @@ type TPatrolEmail = {
5348
5354
  */
5349
5355
  sourceUrl?: string;
5350
5356
  status?: "sent" | "failed" | "deleted";
5357
+ /**
5358
+ * Set when this record was created by resending an earlier one.
5359
+ *
5360
+ * Always points at the **original** email, never at another resend, so the
5361
+ * chain stays one level deep no matter how many attempts are made. A record
5362
+ * with this set never offers a resend button of its own.
5363
+ */
5364
+ sourceEmail?: string | ObjectId | null;
5351
5365
  createdBy: TPatrolEmailCreatedBy;
5352
5366
  createdAt?: string;
5353
5367
  updatedAt?: string;
@@ -5357,6 +5371,14 @@ declare const schemaPatrolEmailLogRef: Joi.ObjectSchema<any>;
5357
5371
  declare const schemaPatrolEmailCreatedBy: Joi.ObjectSchema<any>;
5358
5372
  declare const schemaPatrolEmail: Joi.ObjectSchema<any>;
5359
5373
  declare const schemaSendPatrolEmail: Joi.ObjectSchema<any>;
5374
+ /**
5375
+ * The request body for resending.
5376
+ *
5377
+ * Everything else — subject, recipients, logs, url — is taken from the stored
5378
+ * record rather than the request, so a resend is provably the same email the
5379
+ * original was.
5380
+ */
5381
+ declare const schemaResendPatrolEmail: Joi.ObjectSchema<any>;
5360
5382
  declare const schemaPatrolEmailQuery: Joi.ObjectSchema<any>;
5361
5383
  declare function MPatrolEmail(value: TPatrolEmail): {
5362
5384
  _id: ObjectId | undefined;
@@ -5380,6 +5402,7 @@ declare function MPatrolEmail(value: TPatrolEmail): {
5380
5402
  } | null;
5381
5403
  sourceUrl: string;
5382
5404
  status: "deleted" | "failed" | "sent";
5405
+ sourceEmail: string | ObjectId | null;
5383
5406
  createdBy: {
5384
5407
  _id: string | ObjectId;
5385
5408
  name: string;
@@ -5412,6 +5435,7 @@ declare function usePatrolEmailRepo(): {
5412
5435
  } | undefined;
5413
5436
  sourceUrl?: string | undefined;
5414
5437
  status?: "deleted" | "failed" | "sent" | undefined;
5438
+ sourceEmail?: string | ObjectId | null | undefined;
5415
5439
  createdBy: TPatrolEmailCreatedBy;
5416
5440
  createdAt?: string | undefined;
5417
5441
  updatedAt?: string | undefined;
@@ -5501,6 +5525,29 @@ declare function usePatrolEmailService(): {
5501
5525
  logs: TPatrolEmailLogRef[];
5502
5526
  logCount: number;
5503
5527
  sourceUrl?: string | undefined;
5528
+ sourceEmail?: string | ObjectId | null | undefined;
5529
+ createdBy: TPatrolEmailCreatedBy;
5530
+ createdAt?: string | undefined;
5531
+ updatedAt?: string | undefined;
5532
+ deletedAt?: string | undefined;
5533
+ }>;
5534
+ resend: ({ id, createdBy, cookieHeader, appKey, }: {
5535
+ id: string | ObjectId;
5536
+ createdBy: TPatrolEmailCreatedBy;
5537
+ cookieHeader?: string | undefined;
5538
+ appKey?: "PROPERTY" | "SECURITY" | "HYGIENE" | "MECHANICAL_ELECTRICAL" | "PEST_CONTROL" | "LANDSCAPING" | "POOL_MAINTENANCE" | undefined;
5539
+ }) => Promise<{
5540
+ _id: ObjectId | undefined;
5541
+ pdf: any;
5542
+ status: "sent";
5543
+ site: string | ObjectId;
5544
+ org?: string | ObjectId | undefined;
5545
+ subject: string;
5546
+ recipients: string[];
5547
+ logs: TPatrolEmailLogRef[];
5548
+ logCount: number;
5549
+ sourceUrl?: string | undefined;
5550
+ sourceEmail?: string | ObjectId | null | undefined;
5504
5551
  createdBy: TPatrolEmailCreatedBy;
5505
5552
  createdAt?: string | undefined;
5506
5553
  updatedAt?: string | undefined;
@@ -5524,6 +5571,7 @@ declare function usePatrolEmailService(): {
5524
5571
 
5525
5572
  declare function usePatrolEmailController(): {
5526
5573
  send: (req: Request, res: Response, next: NextFunction) => Promise<void>;
5574
+ resend: (req: Request, res: Response, next: NextFunction) => Promise<void>;
5527
5575
  getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
5528
5576
  getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
5529
5577
  deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
@@ -12572,4 +12620,4 @@ declare function useNotificationPreferenceController(): {
12572
12620
  update: (req: Request, res: Response, next: NextFunction) => Promise<void>;
12573
12621
  };
12574
12622
 
12575
- export { ANPRMode, APP_BASE_URLS, AUDIT_VALUE_MAX_LENGTH, AccessTypeProps, AppKey, AppServiceType, AssignCardConfig, BidStatus, BidType, BuildingLevelStatus, BuildingStatus, BulkCardUpdate, BulletinOrder, BulletinRecipient, BulletinSort, BulletinStatus, BulletinVideoOrder, BulletinVideoSort, CAMERA_ANPR_PERMISSIONS, CAMERA_CAPABILITIES, CAMERA_CAPABILITY_REASONS, CAMERA_MANAGE_ANY_PERMISSIONS, CAMERA_NOT_PATROL_OR_CCTV, CAMERA_NO_SUB_STREAM_TTL_SECONDS, CAMERA_PTZ_PERMISSIONS, CAMERA_REQUEST_TIMEOUT_MS, CAMERA_RTSP_TIMEOUT_MS, CAMERA_SETUP_PERMISSIONS, CAMERA_SNAPSHOT_CACHE_SECONDS, CAMERA_SNAPSHOT_MAX_BYTES, CAMERA_TEST_MIN_INTERVAL_SECONDS, CAMERA_TEST_ROUND_LIMIT, CAMERA_TEST_ROUND_SECONDS, CAMERA_TYPE_ANPR, CAMERA_TYPE_IP, CAMERA_VIEW_PERMISSIONS, CLIENT_ACTIONS, CLOCK_DRIFT_WARN_SECONDS, CONSOLE_AUDIT_LABELS, CURRENT_TIME_ENDPOINT, Camera, CameraAddressInput, CameraCapability, CameraCapabilityContext, CameraCapabilityDescriptor, CameraCapabilityEntry, CameraCapabilityReason, CameraCapabilityState, CameraCapabilityTrace, CameraDevice, CameraFrame, CameraMembership, CameraStream, CameraTestStatus, CameraTransport, CameraType, ConsoleAuditAction, ConsoleAuditTarget, DEVICE_STATUS, DOBStatus, DUPLICATE_TERMS_VERSION_MESSAGE, DayOfWeek, DeviceHttpTarget, DeviceProbeResult, DynamicFormFields, EAccessCardTypes, EAccessCardUserTypes, EmailSender, EntryOrder, EntrySort, EventOrder, EventSort, EventStatus, EventType, FacilitySort, FacilityStatus, FormEntryStatus, GuestSort, GuestStatus, HID_CARD_VALUE_FACTOR, HID_PERMISSION_CATEGORIES, HID_UINT32_MAX, HID_UINT64_MAX, HidRawUint64, IAccessCard, IAccessCardTransaction, InviteActor, LIVE_ROLE, MAX_CAMERA_CHANNEL, MAccessCard, MAccessCardTransaction, MAddress, MAttendance, MAttendanceSettings, MBidPreloved, MBillingConfiguration, MBillingItem, MBuilding, MBuildingLevel, MBuildingUnit, MBulletinBoard, MBulletinVideo, MCategoryPreloved, MChannelPreloved, MChat, MChatPreloved, MConsoleAudit, MCustomer, MCustomerSite, MDocumentManagement, MEMBER_TYPES, MEntryPassSettings, MEventManagement, MFeedback, MFile, MFormEntry, MGuestManagement, MHidAmicoEvent, MHidAmicoIdentity, MHidAmicoReader, MHidSipAccount, MHidSitePermissions, MIncidentReport, MManpowerDesignations, MManpowerMonitoring, MManpowerRemarks, MManpowerSites, MMember, MNfcPatrolLog, MNfcPatrolRoute, MNfcPatrolSettings, MNfcPatrolSettingsUpdate, MNfcPatrolTag, MNotification, MNotificationPreference, MOccurrenceBook, MOccurrenceEntry, MOccurrenceSubject, MOnlineForm, MOrg, MOvernightParkingApprovalHours, MOvernightParkingRequest, MPatrolEmail, MPatrolLog, MPatrolQuestion, MPatrolRoute, MPerson, MPlatformTerms, MPost, MPostFavorite, MPromoCode, MRobot, MRole, MRoleV2, MServiceProvider, MServiceProviderBilling, MSession, MSite, MSiteCamera, MSiteFacility, MSiteFacilityBooking, MStatementOfAccount, MSubcategoryPreloved, MSubscription, MSubscriptionPlan, MUnitBilling, MUser, MVehicle, MVehicleTransaction, MVerification, MVerificationV2, MVisitorTransaction, MWorkOrder, NOTIFICATION_CATEGORIES, NOTIFICATION_CHANNELS, NOTIFICATION_CHANNEL_LABELS, NOTIFICATION_NAMESPACE, NotificationAppSlug, NotificationCategory, NotificationChannel, NotificationModule, NotificationPreferenceView, NotificationService, ORG_MARKETPLACE_VENDOR_FIELD, OrgNature, OvernightParkingRequestSort, OvernightParkingRequestStatus, PATROL_CCTV_CAMERA_FILTER, PATROL_EMAIL_MAX_LOGS, PATROL_EMAIL_MAX_PER_HOUR, PATROL_EMAIL_MAX_RECIPIENTS, PERSON_TYPES, PLATFORM_STAFF_MEMBER_TYPE, PLATFORM_STAFF_ROLE_TYPE, PROPERTY_MANAGEMENT_MEMBER_TYPES, PStatus, PTZ_ALLOWED_ACTIONS, PTZ_ALLOWED_CODES, Period, PersonStatus, PersonType, PersonTypes, PlatformTermsStatus, PostOrder, PostSort, PostStatus, QrTagProps, REALTIME_MAX_FANOUT, ResidentAppModuleKey, SELF_SIGNUP_PLATFORM, SELF_SIGNUP_STATUS, SELF_SIGNUP_TYPES, SERVICE_PROVIDER_INVITE_LABELS, SERVICE_PROVIDER_INVITE_TRANSITIONS, SERVICE_PROVIDER_SIGN_IN_SUBJECT, SERVICE_PROVIDER_SIGN_IN_TYPE, SERVICE_PROVIDER_SIGN_UP_SUBJECT, SERVICE_PROVIDER_SIGN_UP_TYPE, SOFTWARE_VERSION_ENDPOINT, ServiceProviderInviteAction, ServiceProviderInviteDecision, ServiceProviderInviteFacts, SiteAddress, SiteCategories, SiteStatus, SortFields, SortOrder, Status, SubjectOrder, SubjectSort, SubscriptionBillingMode, SubscriptionType, TAccessMngmntSettings, TActionStatus, TAddress, TAffectedEntities, TAffectedInjured, TAppServiceType, TApprovedBy, TApprover, TAttendance, TAttendanceCheckIn, TAttendanceCheckOut, TAttendanceCheckTime, TAttendanceLocation, TAttendanceSettings, TAttendanceSettingsGetBySite, TAuthorities, TAuthoritiesCalled, TBidPreloved, TBilling, TBillingConfiguration, TBillingItem, TBuilding, TBuildingLevel, TBuildingUnit, TBulletinBoard, TBulletinVideo, TCamera, TCameraHealthClaim, TCategoryPreloved, TChannelPreloved, TChat, TChatPreloved, TCheckPoint$1 as TCheckPoint, TComplaintInfo, TComplaintReceivedTo, TConsoleAudit, TConsoleAuditQuery, TCounter, TCreateNfcPatrolLog, TCustomer, TCustomerSite, TCustomerSitePropertyField, TDayNumber, TDaySchedule, TDefaultAccessCard, TDesignations, TDocs, TDocumentCreate, TDocumentManagement, TEntryPassSettings, TEventManagement, TFeedback, TFeedbackMetadata, TFeedbackUpdate, TFeedbackUpdateCategory, TFeedbackUpdateServiceProvider, TFeedbackUpdateStatus, TFeedbackUpdateToCompleted, TFile, TFiles, TFolderUpdate, TFormEntry, TGetAttendancesByUserQuery, TGetAttendancesQuery, TGuestManagement, THidAmicoEvent, THidAmicoGatewayJob, THidAmicoIdentity, THidAmicoPhysicalCard, THidAmicoReader, THidPermissionAssignment, THidPermissionCategory, THidPhysicalCardInput, THidPhysicalCardType$1 as THidPhysicalCardType, THidSipAccount, THidSitePermissions, TIncidentInformation, TIncidentReport, TIncidentTypeAndTime, TInvoice, TKeyRef, TManpowerDesignations, TManpowerDesignationsUpdate, TManpowerMonitoring, TManpowerMonitoringUpdate, TManpowerRemarks, TManpowerRemarksStatusUpdate, TManpowerRemarksUpdate, TManpowerSearchFilter, TManpowerSites, TMember, TMemberUpdateStatus, TMessagePreloved, TMiniRole, TNfcPatrolLog, TNfcPatrolRoute, TNfcPatrolRouteEdit, TNfcPatrolSettings, TNfcPatrolSettingsGetBySite, TNfcPatrolSettingsUpdate, TNfcPatrolTag, TNfcPatrolTagConfigureReset, TNfcPatrolTagEdit, TNfcPatrolTagUpdateData, TNotification, TNotificationPreference, TNotificationPreferenceOff, TOccurrenceBook, TOccurrenceEntry, TOccurrenceSubject, TOnlineForm, TOrg, TOvernightParkingApprovalHours, TOvernightParkingRequest, TPatrolEmail, TPatrolEmailCreatedBy, TPatrolEmailLogRef, TPatrolLog, TPatrolQuestion, TPatrolRoute, TPerson, TPlaceOfIncident, TPlates, TPlatformTerms, TPost, TPostFavorite, TPrice, TPriceType, TPromoCode, TPromoCurrencyInput, TPromoTier, TRANSPORT_DEVICE_HTTP, TRANSPORT_RELAY_PLAYER, TRANSPORT_RTSP_FRAME, TRecipientOfComplaint, TRemarks, TResident, TResidentAppModules, TRobot, TRobotMetadata, TRole, TRoleV2, TRoute, TSOABillingItem, TSOAStatus, TServiceProvider, TServiceProviderBilling, TSession, TSessionCreate, TShifts, TSignNfcPatrolLog, TSite, TSiteCamera, TSiteFacility, TSiteFacilityBooking, TSiteInfo, TSiteInformation, TSiteMetadata, TSiteUpdateBlock, TStatementOfAccount, TSubcategoryPreloved, TSubmissionForm, TSubscription, TSubscriptionPlan, TSubscriptionPlanApplication, TUnitBilling, TUnits, TUpdateFormEntry, TUpdateName, TUser, TUserCreate, TVehicle, TVehicleTransaction, TVehicleUpdate, TVerification, TVerificationEvent, TVerificationMetadata, TVerificationMetadataV2, TVerificationV2, TVisitorTransaction, TWorkOrder, TWorkOrderMetadata, TWorkOrderUpdate, TWorkOrderUpdateStatus, TWorkOrderUpdateToCompleted, TanyoneDamageToProperty, UseAccessManagementRepo, UserStatus, VERIFICATION_OPEN_STATUSES, VehicleCategory, VehicleOrder, VehicleSort, VehicleStatus, VehicleType, VerificationLinkType, VerificationStatus, VerificationSubjectType, VerificationType, VisitorSort, VisitorStatus, addressSchema, allowedFieldsSite, allowedNatures, allowedPlanApplications, attendanceSchema, attendanceSettingsSchema, building_level_namespace_collection, building_units_namespace_collection, buildings_namespace_collection, bulletin_boards_namespace_collection, cameraBaseUrl, cameraCapabilitiesFor, cameraDevices, cameraGrant, cameraHealthClaim, cameraHealthSummary, cameraManagePermissions, cameraProbeCacheKey, cameraTransports, canRevokeRefreshTokenFamily, categoriesForPermissions, categorySupportsChannel, chatPrelovedEvents, chatSchema, clampPtzSpeed, clockDriftSeconds, console_audit_namespace_collection, createManpowerRemarksDaily, customerSchema, customerSitePropertyFields, decideServiceProviderInvite, decodeHidPacsCard, deriveCameraHost, describeCameraCapabilities, designationsSchema, deviceControlEnabled, deviceHttpEnabled, deviceHttpTargets, deviceHttpTimeoutMs, deviceProbeTtlSeconds, emitNotificationCreated, encodeHidPacsCard, events_namespace_collection, facility_bookings_namespace_collection, feedbackSchema, feedbacks2_namespace_collection, feedbacks_namespace_collection, ffmpegFrameArgs, ffmpegPath, formatCapabilityTrace, formatDahuaDate, getIO, getSessionIdFromRequest, grabWithSubStreamFallback, guests_namespace_collection, hasAnyCapability, hasAnyPermission, hasOrgInvitation, hidRawUint64, incidentReport, incidentReportLog, incidents_namespace_collection, isCameraEntitled, isDuplicateVersionError, isPatrolCctvCamera, isPlatformOwner, isPromoCodeExpired, isRelayPlayerUrl, isSafeRelativePath, isSuperAdmin, isTermsCurrent, logCamera, manpowerDesignationsSchema, manpowerEvents, manpowerMonitoringSchema, manpowerRemarksSchema, manpowerSitesSchema, mapWithLimit, nfcPatrolSettingsSchema, nfcPatrolSettingsSchemaUpdate, normalizeAcceptedTerms, normalizeHidCardValue, notificationCategory, notificationCategoryLabel, notificationEvents, notificationRoom, occurrence_book_namespace_collection, online_forms_namespace_collection, orgSchema, overnight_parking_requests_namespace_collection, parseCameraChannel, parseCameraHost, parseDahuaFind, parseDeviceTime, parseHidJsonLossless, parsePromoExpiry, parseSoftwareVersion, pickAuditFields, pickCustomerSiteProperties, platform_terms_namespace_collection, promoCodeRefusal, promoCodeSchema, promoCodeStatusSchema, promoCodeUpdate, promoCodeUpdateSchema, ptzEndpoint, publicCameraFields, recordConsoleAction, refuseServiceProviderInviteAction, registerCameraTransport, relayForRecorder, remarksSchema, renderPagePdf, resetCameraTransports, residentAppModuleKeys, residentFormEntry, resolutionRefusalReason, resolveCamera, resolveDeviceHttp, resolveHidPhysicalCardValue, resolveInviteActor, robotSchema, rtspUrl, schema, schemaAppSlugNotification, schemaApprovedBy, schemaApprover, schemaBidPreloved, schemaBilling, schemaBillingConfiguration, schemaBillingItem, schemaBuilding, schemaBuildingLevel, schemaBuildingUnit, schemaBuildingUpdateOptions, schemaBulletinBoard, schemaBulletinVideo, schemaCategoryPreloved, schemaChannelPreloved, schemaChatPreloved, schemaConsoleAudit, schemaCreateHidAmicoIdentity, schemaCreateNfcPatrolLog, schemaCreateNotification, schemaCustomerSite, schemaDiscoverHidAmicoReader, schemaDocumentManagement, schemaEntryPassSettings, schemaEventManagement, schemaFiles, schemaFormEntry, schemaGuestManagement, schemaHidAmicoAccessLogQuery, schemaHidAmicoAssignUserCard, schemaHidAmicoConfiguration, schemaHidAmicoEnrollUserCard, schemaHidAmicoEvent, schemaHidAmicoExecuteActions, schemaHidAmicoIdentity, schemaHidAmicoIdentityIdParams, schemaHidAmicoIdentityQuery, schemaHidAmicoIntercomCall, schemaHidAmicoLogQuery, schemaHidAmicoMonitor, schemaHidAmicoNotificationParams, schemaHidAmicoObjectOperation, schemaHidAmicoOperatingMode, schemaHidAmicoReader, schemaHidAmicoReaderIdParams, schemaHidAmicoReaderListQuery, schemaHidAmicoReaderUserQuery, schemaHidAmicoSetConfiguration, schemaHidAmicoSiteIdParams, schemaHidAmicoSync, schemaHidAmicoUserCardIdParams, schemaHidAmicoUserCardParams, schemaHidAmicoUserImageParams, schemaHidAmicoUserImageUploadQuery, schemaHidAmicoUserPin, schemaHidAmicoUserPinParams, schemaHidAmicoVisitorImageParams, schemaHidAmicoVisitorImageUploadQuery, schemaHidAmicoVisitorQr, schemaHidPermissionCandidateQuery, schemaHidPermissionScopeQuery, schemaHidSipAccountRequest, schemaIncidentReport, schemaListNotification, schemaMultipleDocumentManagement, schemaNfcPatrolLog, schemaNfcPatrolRoute, schemaNfcPatrolTag, schemaNfcPatrolTagUpdateData, schemaNotification, schemaNotificationPreference, schemaNotificationPreferenceOff, schemaOccurrenceBook, schemaOccurrenceEntry, schemaOccurrenceSubject, schemaOnlineForm, schemaOvernightParkingApprovalHours, schemaOvernightParkingRequest, schemaPatrolEmail, schemaPatrolEmailCreatedBy, schemaPatrolEmailLogRef, schemaPatrolEmailQuery, schemaPatrolLog, schemaPatrolQuestion, schemaPatrolRoute, schemaPerson, schemaPlate, schemaPlatformTerms, schemaPost, schemaPostFavorite, schemaResidentSelfSignUp, schemaSelfServiceVisitor, schemaSendPatrolEmail, schemaServiceProvider, schemaServiceProviderBilling, schemaSignNfcPatrolLog, schemaSiteCamera, schemaSiteFacility, schemaSiteFacilityBooking, schemaStatementOfAccount, schemaSubcategoryPreloved, schemaUnitBilling, schemaUpdateBidPreloved, schemaUpdateBuildingLevel, schemaUpdateBulletinBoard, schemaUpdateBulletinVideo, schemaUpdateCategoryPreloved, schemaUpdateChatPreloved, schemaUpdateDocumentManagement, schemaUpdateEntryPassSettings, schemaUpdateEventManagement, schemaUpdateFolderManagement, schemaUpdateFormEntry, schemaUpdateGuestManagement, schemaUpdateHidAmicoIdentity, schemaUpdateHidAmicoReader, schemaUpdateHidSitePermissions, schemaUpdateIncidentReport, schemaUpdateNotification, schemaUpdateNotificationPreference, schemaUpdateOccurrenceBook, schemaUpdateOccurrenceEntry, schemaUpdateOccurrenceSubject, schemaUpdateOnlineForm, schemaUpdateOptions, schemaUpdateOvernightParkingRequest, schemaUpdatePatrolLog, schemaUpdatePatrolQuestion, schemaUpdatePatrolRoute, schemaUpdatePerson, schemaUpdatePost, schemaUpdatePostFavorite, schemaUpdateServiceProviderBilling, schemaUpdateSiteBillingConfiguration, schemaUpdateSiteBillingItem, schemaUpdateSiteCamera, schemaUpdateSiteFacility, schemaUpdateSiteFacilityBooking, schemaUpdateSiteUnitBilling, schemaUpdateStatementOfAccount, schemaUpdateSubcategoryPreloved, schemaUpdateVisTrans, schemaVehicleTransaction, schemaVisitorTransaction, schemeCamera, schemeLogCamera, serviceProviderInviteLabel, sessionSchema, setIO, shiftSchema, siteSchema, site_people_namespace_collection, snapshotEndpoint, snapshotRefusalReason, stringifyHidJson, subscriptionPlanSchema, updateRemarksStatusEod, updateRemarksisAcknowledged, updateSiteSchema, useAccessManagementController, useAddressRepo, useAttendanceController, useAttendanceRepository, useAttendanceSettingsController, useAttendanceSettingsRepository, useAttendanceSettingsService, useAuthController, useAuthControllerV2, useAuthService, useAuthServiceV2, useBidPrelovedController, useBidPrelovedRepo, useBidPrelovedService, useBuildingController, useBuildingLevelController, useBuildingLevelRepo, useBuildingLevelService, useBuildingRepo, useBuildingService, useBuildingUnitController, useBuildingUnitRepo, useBuildingUnitService, useBulletinBoardController, useBulletinBoardRepo, useBulletinBoardService, useBulletinVideoController, useBulletinVideoRepo, useBulletinVideoService, useCameraViewController, useCameraViewService, useCategoryPrelovedController, useCategoryPrelovedRepo, useChannelPrelovedController, useChannelPrelovedRepo, useChatController, useChatPrelovedController, useChatPrelovedRepo, useChatPrelovedService, useChatRepo, useConsoleAuditController, useConsoleAuditRepo, useCounterModel, useCounterRepo, useCustomerController, useCustomerRepo, useCustomerSiteController, useCustomerSiteRepo, useCustomerSiteService, useDahuaService, useDashboardController, useDashboardRepo, useDocumentManagementController, useDocumentManagementRepo, useDocumentManagementService, useEntryPassSettingsController, useEntryPassSettingsRepo, useEventManagementController, useEventManagementRepo, useEventManagementService, useFeedbackController, useFeedbackRepo, useFeedbackService, useFileController, useFileRepo, useFileService, useFormEntryController, useFormEntryRepo, useGuestManagementController, useGuestManagementRepo, useGuestManagementService, useHidAmicoController, useHidAmicoRepo, useHidAmicoService, useHrmLabsAttendanceCtrl, useHrmLabsAttendanceSrvc, useIncidentReportController, useIncidentReportRepo, useIncidentReportService, useInvoiceController, useInvoiceModel, useInvoiceRepo, useManpowerDesignationCtrl, useManpowerDesignationRepo, useManpowerMonitoringCtrl, useManpowerMonitoringRepo, useManpowerMonitoringSrvc, useManpowerRemarkCtrl, useManpowerRemarksRepo, useManpowerSitesCtrl, useManpowerSitesRepo, useManpowerSitesSrvc, useMemberController, useMemberRepo, useMemberService, useNewDashboardController, useNewDashboardRepo, useNfcPatrolLogController, useNfcPatrolLogRepo, useNfcPatrolLogService, useNfcPatrolRouteController, useNfcPatrolRouteRepo, useNfcPatrolRouteService, useNfcPatrolSettingsController, useNfcPatrolSettingsRepository, useNfcPatrolSettingsService, useNfcPatrolTagController, useNfcPatrolTagRepo, useNfcPatrolTagService, useNotificationController, useNotificationPreferenceController, useNotificationPreferenceRepo, useNotificationPreferenceService, useNotificationRepo, useOccurrenceBookController, useOccurrenceBookRepo, useOccurrenceBookService, useOccurrenceEntryController, useOccurrenceEntryRepo, useOccurrenceEntryService, useOccurrenceSubjectController, useOccurrenceSubjectRepo, useOccurrenceSubjectService, useOnlineFormController, useOnlineFormRepo, useOrgController, useOrgControllerV2, useOrgRepo, useOvernightParkingController, useOvernightParkingRepo, useOvernightParkingRequestController, useOvernightParkingRequestRepo, useOvernightParkingRequestService, usePatrolEmailController, usePatrolEmailRepo, usePatrolEmailService, usePatrolLogController, usePatrolLogRepo, usePatrolLogService, usePatrolQuestionController, usePatrolQuestionRepo, usePatrolRouteController, usePatrolRouteRepo, usePersonController, usePersonRepo, usePlatformTermsController, usePlatformTermsRepo, usePlatformTermsService, usePostFavoriteController, usePostFavoriteRepo, usePostFavoriteService, usePostPrelovedController, usePostPrelovedRepo, usePriceController, usePriceModel, usePriceRepo, usePromoCodeController, usePromoCodeRepo, useRedDotPaymentController, useRedDotPaymentRepo, useRedDotPaymentSvc, useRobotController, useRobotRepo, useRobotService, useRoleController, useRoleControllerV2, useRoleRepo, useRoleRepoV2, useRoleServiceV2, useServiceProviderBillingController, useServiceProviderBillingRepo, useServiceProviderBillingService, useServiceProviderController, useServiceProviderInviteController, useServiceProviderInviteService, useServiceProviderRepo, useSessionRepo, useSiteBillingConfigurationController, useSiteBillingConfigurationRepo, useSiteBillingItemController, useSiteBillingItemRepo, useSiteCameraController, useSiteCameraRepo, useSiteCameraService, useSiteController, useSiteFacilityBookingController, useSiteFacilityBookingRepo, useSiteFacilityBookingService, useSiteFacilityController, useSiteFacilityRepo, useSiteFacilityService, useSiteRepo, useSiteService, useSiteUnitBillingController, useSiteUnitBillingRepo, useSiteUnitBillingService, useStatementOfAccountController, useStatementOfAccountRepo, useSubcategoryPrelovedController, useSubcategoryPrelovedRepo, useSubscriptionController, useSubscriptionPlanController, useSubscriptionPlanRepo, useSubscriptionRepo, useSubscriptionService, useUserController, useUserControllerV2, useUserRepo, useUserRepoV2, useUserService, useUserServiceV2, useVehicleController, useVehicleRepo, useVehicleService, useVerificationController, useVerificationControllerV2, useVerificationRepo, useVerificationRepoV2, useVerificationService, useVerificationServiceV2, useVisitorTransactionController, useVisitorTransactionRepo, useVisitorTransactionService, useWorkOrderController, useWorkOrderRepo, useWorkOrderService, userSchema, vehicleSchema, vehicles_namespace_collection, visitorPersonRepo, visitorPersonService, visitorType, visitors_namespace_collection, wallConfig, workOrderSchema, work_orders2_namespace_collection, work_orders_namespace_collection };
12623
+ export { ANPRMode, APP_BASE_URLS, AUDIT_VALUE_MAX_LENGTH, AccessTypeProps, AppKey, AppServiceType, AssignCardConfig, BidStatus, BidType, BuildingLevelStatus, BuildingStatus, BulkCardUpdate, BulletinOrder, BulletinRecipient, BulletinSort, BulletinStatus, BulletinVideoOrder, BulletinVideoSort, CAMERA_ANPR_PERMISSIONS, CAMERA_CAPABILITIES, CAMERA_CAPABILITY_REASONS, CAMERA_MANAGE_ANY_PERMISSIONS, CAMERA_NOT_PATROL_OR_CCTV, CAMERA_NO_SUB_STREAM_TTL_SECONDS, CAMERA_PTZ_PERMISSIONS, CAMERA_REQUEST_TIMEOUT_MS, CAMERA_RTSP_TIMEOUT_MS, CAMERA_SETUP_PERMISSIONS, CAMERA_SNAPSHOT_CACHE_SECONDS, CAMERA_SNAPSHOT_MAX_BYTES, CAMERA_TEST_MIN_INTERVAL_SECONDS, CAMERA_TEST_ROUND_LIMIT, CAMERA_TEST_ROUND_SECONDS, CAMERA_TYPE_ANPR, CAMERA_TYPE_IP, CAMERA_VIEW_PERMISSIONS, CLIENT_ACTIONS, CLOCK_DRIFT_WARN_SECONDS, CONSOLE_AUDIT_LABELS, CURRENT_TIME_ENDPOINT, Camera, CameraAddressInput, CameraCapability, CameraCapabilityContext, CameraCapabilityDescriptor, CameraCapabilityEntry, CameraCapabilityReason, CameraCapabilityState, CameraCapabilityTrace, CameraDevice, CameraFrame, CameraMembership, CameraStream, CameraTestStatus, CameraTransport, CameraType, ConsoleAuditAction, ConsoleAuditTarget, DEVICE_STATUS, DOBStatus, DUPLICATE_TERMS_VERSION_MESSAGE, DayOfWeek, DeviceHttpTarget, DeviceProbeResult, DynamicFormFields, EAccessCardTypes, EAccessCardUserTypes, EmailSender, EntryOrder, EntrySort, EventOrder, EventSort, EventStatus, EventType, FacilitySort, FacilityStatus, FormEntryStatus, GuestSort, GuestStatus, HID_CARD_VALUE_FACTOR, HID_PERMISSION_CATEGORIES, HID_UINT32_MAX, HID_UINT64_MAX, HidRawUint64, IAccessCard, IAccessCardTransaction, InviteActor, LIVE_ROLE, MAX_CAMERA_CHANNEL, MAccessCard, MAccessCardTransaction, MAddress, MAttendance, MAttendanceSettings, MBidPreloved, MBillingConfiguration, MBillingItem, MBuilding, MBuildingLevel, MBuildingUnit, MBulletinBoard, MBulletinVideo, MCategoryPreloved, MChannelPreloved, MChat, MChatPreloved, MConsoleAudit, MCustomer, MCustomerSite, MDocumentManagement, MEMBER_TYPES, MEntryPassSettings, MEventManagement, MFeedback, MFile, MFormEntry, MGuestManagement, MHidAmicoEvent, MHidAmicoIdentity, MHidAmicoReader, MHidSipAccount, MHidSitePermissions, MIncidentReport, MManpowerDesignations, MManpowerMonitoring, MManpowerRemarks, MManpowerSites, MMember, MNfcPatrolLog, MNfcPatrolRoute, MNfcPatrolSettings, MNfcPatrolSettingsUpdate, MNfcPatrolTag, MNotification, MNotificationPreference, MOccurrenceBook, MOccurrenceEntry, MOccurrenceSubject, MOnlineForm, MOrg, MOvernightParkingApprovalHours, MOvernightParkingRequest, MPatrolEmail, MPatrolLog, MPatrolQuestion, MPatrolRoute, MPerson, MPlatformTerms, MPost, MPostFavorite, MPromoCode, MRobot, MRole, MRoleV2, MServiceProvider, MServiceProviderBilling, MSession, MSite, MSiteCamera, MSiteFacility, MSiteFacilityBooking, MStatementOfAccount, MSubcategoryPreloved, MSubscription, MSubscriptionPlan, MUnitBilling, MUser, MVehicle, MVehicleTransaction, MVerification, MVerificationV2, MVisitorTransaction, MWorkOrder, NOTIFICATION_CATEGORIES, NOTIFICATION_CHANNELS, NOTIFICATION_CHANNEL_LABELS, NOTIFICATION_NAMESPACE, NotificationAppSlug, NotificationCategory, NotificationChannel, NotificationModule, NotificationPreferenceView, NotificationService, ORG_MARKETPLACE_VENDOR_FIELD, OrgNature, OvernightParkingRequestSort, OvernightParkingRequestStatus, PATROL_CCTV_CAMERA_FILTER, PATROL_EMAIL_MAX_LOGS, PATROL_EMAIL_MAX_PER_HOUR, PATROL_EMAIL_MAX_RECIPIENTS, PERSON_TYPES, PLATFORM_STAFF_MEMBER_TYPE, PLATFORM_STAFF_ROLE_TYPE, PROPERTY_MANAGEMENT_MEMBER_TYPES, PStatus, PTZ_ALLOWED_ACTIONS, PTZ_ALLOWED_CODES, Period, PersonStatus, PersonType, PersonTypes, PlatformTermsStatus, PostOrder, PostSort, PostStatus, QrTagProps, REALTIME_MAX_FANOUT, ResidentAppModuleKey, SELF_SIGNUP_PLATFORM, SELF_SIGNUP_STATUS, SELF_SIGNUP_TYPES, SERVICE_PROVIDER_INVITE_LABELS, SERVICE_PROVIDER_INVITE_TRANSITIONS, SERVICE_PROVIDER_SIGN_IN_SUBJECT, SERVICE_PROVIDER_SIGN_IN_TYPE, SERVICE_PROVIDER_SIGN_UP_SUBJECT, SERVICE_PROVIDER_SIGN_UP_TYPE, SOFTWARE_VERSION_ENDPOINT, ServiceProviderInviteAction, ServiceProviderInviteDecision, ServiceProviderInviteFacts, SiteAddress, SiteCategories, SiteStatus, SortFields, SortOrder, Status, SubjectOrder, SubjectSort, SubscriptionBillingMode, SubscriptionType, TAccessMngmntSettings, TActionStatus, TAddress, TAffectedEntities, TAffectedInjured, TAppServiceType, TApprovedBy, TApprover, TAttendance, TAttendanceCheckIn, TAttendanceCheckOut, TAttendanceCheckTime, TAttendanceLocation, TAttendanceSettings, TAttendanceSettingsGetBySite, TAuthorities, TAuthoritiesCalled, TBidPreloved, TBilling, TBillingConfiguration, TBillingItem, TBuilding, TBuildingLevel, TBuildingUnit, TBulletinBoard, TBulletinVideo, TCamera, TCameraHealthClaim, TCategoryPreloved, TChannelPreloved, TChat, TChatPreloved, TCheckPoint$1 as TCheckPoint, TComplaintInfo, TComplaintReceivedTo, TConsoleAudit, TConsoleAuditQuery, TCounter, TCreateNfcPatrolLog, TCustomer, TCustomerSite, TCustomerSitePropertyField, TDayNumber, TDaySchedule, TDefaultAccessCard, TDesignations, TDocs, TDocumentCreate, TDocumentManagement, TEntryPassSettings, TEventManagement, TFeedback, TFeedbackMetadata, TFeedbackUpdate, TFeedbackUpdateCategory, TFeedbackUpdateServiceProvider, TFeedbackUpdateStatus, TFeedbackUpdateToCompleted, TFile, TFiles, TFolderUpdate, TFormEntry, TGetAttendancesByUserQuery, TGetAttendancesQuery, TGuestManagement, THidAmicoEvent, THidAmicoGatewayJob, THidAmicoIdentity, THidAmicoPhysicalCard, THidAmicoReader, THidPermissionAssignment, THidPermissionCategory, THidPhysicalCardInput, THidPhysicalCardType$1 as THidPhysicalCardType, THidSipAccount, THidSitePermissions, TIncidentInformation, TIncidentReport, TIncidentTypeAndTime, TInvoice, TKeyRef, TManpowerDesignations, TManpowerDesignationsUpdate, TManpowerMonitoring, TManpowerMonitoringUpdate, TManpowerRemarks, TManpowerRemarksStatusUpdate, TManpowerRemarksUpdate, TManpowerSearchFilter, TManpowerSites, TMember, TMemberUpdateStatus, TMessagePreloved, TMiniRole, TNfcPatrolLog, TNfcPatrolRoute, TNfcPatrolRouteEdit, TNfcPatrolSettings, TNfcPatrolSettingsGetBySite, TNfcPatrolSettingsUpdate, TNfcPatrolTag, TNfcPatrolTagConfigureReset, TNfcPatrolTagEdit, TNfcPatrolTagUpdateData, TNotification, TNotificationPreference, TNotificationPreferenceOff, TOccurrenceBook, TOccurrenceEntry, TOccurrenceSubject, TOnlineForm, TOrg, TOvernightParkingApprovalHours, TOvernightParkingRequest, TPatrolEmail, TPatrolEmailCreatedBy, TPatrolEmailLogRef, TPatrolLog, TPatrolQuestion, TPatrolRoute, TPerson, TPlaceOfIncident, TPlates, TPlatformTerms, TPost, TPostFavorite, TPrice, TPriceType, TPromoCode, TPromoCurrencyInput, TPromoTier, TRANSPORT_DEVICE_HTTP, TRANSPORT_RELAY_PLAYER, TRANSPORT_RTSP_FRAME, TRecipientOfComplaint, TRemarks, TResident, TResidentAppModules, TRobot, TRobotMetadata, TRole, TRoleV2, TRoute, TSOABillingItem, TSOAStatus, TServiceProvider, TServiceProviderBilling, TSession, TSessionCreate, TShifts, TSignNfcPatrolLog, TSite, TSiteCamera, TSiteFacility, TSiteFacilityBooking, TSiteInfo, TSiteInformation, TSiteMetadata, TSiteUpdateBlock, TStatementOfAccount, TSubcategoryPreloved, TSubmissionForm, TSubscription, TSubscriptionPlan, TSubscriptionPlanApplication, TUnitBilling, TUnits, TUpdateFormEntry, TUpdateName, TUser, TUserCreate, TVehicle, TVehicleTransaction, TVehicleUpdate, TVerification, TVerificationEvent, TVerificationMetadata, TVerificationMetadataV2, TVerificationV2, TVisitorTransaction, TWorkOrder, TWorkOrderMetadata, TWorkOrderUpdate, TWorkOrderUpdateStatus, TWorkOrderUpdateToCompleted, TanyoneDamageToProperty, UseAccessManagementRepo, UserStatus, VERIFICATION_OPEN_STATUSES, VehicleCategory, VehicleOrder, VehicleSort, VehicleStatus, VehicleType, VerificationLinkType, VerificationStatus, VerificationSubjectType, VerificationType, VisitorSort, VisitorStatus, addressSchema, allowedFieldsSite, allowedNatures, allowedPlanApplications, attendanceSchema, attendanceSettingsSchema, building_level_namespace_collection, building_units_namespace_collection, buildings_namespace_collection, bulletin_boards_namespace_collection, cameraBaseUrl, cameraCapabilitiesFor, cameraDevices, cameraGrant, cameraHealthClaim, cameraHealthSummary, cameraManagePermissions, cameraProbeCacheKey, cameraTransports, canRevokeRefreshTokenFamily, categoriesForPermissions, categorySupportsChannel, chatPrelovedEvents, chatSchema, clampPtzSpeed, clockDriftSeconds, console_audit_namespace_collection, createManpowerRemarksDaily, customerSchema, customerSitePropertyFields, decideServiceProviderInvite, decodeHidPacsCard, deriveCameraHost, describeCameraCapabilities, designationsSchema, deviceControlEnabled, deviceHttpEnabled, deviceHttpTargets, deviceHttpTimeoutMs, deviceProbeTtlSeconds, emitNotificationCreated, encodeHidPacsCard, events_namespace_collection, facility_bookings_namespace_collection, feedbackSchema, feedbacks2_namespace_collection, feedbacks_namespace_collection, ffmpegFrameArgs, ffmpegPath, formatCapabilityTrace, formatDahuaDate, getIO, getSessionIdFromRequest, grabWithSubStreamFallback, guests_namespace_collection, hasAnyCapability, hasAnyPermission, hasOrgInvitation, hidRawUint64, incidentReport, incidentReportLog, incidents_namespace_collection, isCameraEntitled, isDuplicateVersionError, isPatrolCctvCamera, isPlatformOwner, isPromoCodeExpired, isRelayPlayerUrl, isSafeRelativePath, isSuperAdmin, isTermsCurrent, logCamera, manpowerDesignationsSchema, manpowerEvents, manpowerMonitoringSchema, manpowerRemarksSchema, manpowerSitesSchema, mapWithLimit, nfcPatrolSettingsSchema, nfcPatrolSettingsSchemaUpdate, normalizeAcceptedTerms, normalizeHidCardValue, notificationCategory, notificationCategoryLabel, notificationEvents, notificationRoom, occurrence_book_namespace_collection, online_forms_namespace_collection, orgSchema, overnight_parking_requests_namespace_collection, parseCameraChannel, parseCameraHost, parseDahuaFind, parseDeviceTime, parseHidJsonLossless, parsePromoExpiry, parseSoftwareVersion, pickAuditFields, pickCustomerSiteProperties, platform_terms_namespace_collection, promoCodeRefusal, promoCodeSchema, promoCodeStatusSchema, promoCodeUpdate, promoCodeUpdateSchema, ptzEndpoint, publicCameraFields, recordConsoleAction, refuseServiceProviderInviteAction, registerCameraTransport, relayForRecorder, remarksSchema, renderPagePdf, resetCameraTransports, residentAppModuleKeys, residentFormEntry, resolutionRefusalReason, resolveCamera, resolveDeviceHttp, resolveHidPhysicalCardValue, resolveInviteActor, robotSchema, rtspUrl, schema, schemaAppSlugNotification, schemaApprovedBy, schemaApprover, schemaBidPreloved, schemaBilling, schemaBillingConfiguration, schemaBillingItem, schemaBuilding, schemaBuildingLevel, schemaBuildingUnit, schemaBuildingUpdateOptions, schemaBulletinBoard, schemaBulletinVideo, schemaCategoryPreloved, schemaChannelPreloved, schemaChatPreloved, schemaConsoleAudit, schemaCreateHidAmicoIdentity, schemaCreateNfcPatrolLog, schemaCreateNotification, schemaCustomerSite, schemaDiscoverHidAmicoReader, schemaDocumentManagement, schemaEntryPassSettings, schemaEventManagement, schemaFiles, schemaFormEntry, schemaGuestManagement, schemaHidAmicoAccessLogQuery, schemaHidAmicoAssignUserCard, schemaHidAmicoConfiguration, schemaHidAmicoEnrollUserCard, schemaHidAmicoEvent, schemaHidAmicoExecuteActions, schemaHidAmicoIdentity, schemaHidAmicoIdentityIdParams, schemaHidAmicoIdentityQuery, schemaHidAmicoIntercomCall, schemaHidAmicoLogQuery, schemaHidAmicoMonitor, schemaHidAmicoNotificationParams, schemaHidAmicoObjectOperation, schemaHidAmicoOperatingMode, schemaHidAmicoReader, schemaHidAmicoReaderIdParams, schemaHidAmicoReaderListQuery, schemaHidAmicoReaderUserQuery, schemaHidAmicoSetConfiguration, schemaHidAmicoSiteIdParams, schemaHidAmicoSync, schemaHidAmicoUserCardIdParams, schemaHidAmicoUserCardParams, schemaHidAmicoUserImageParams, schemaHidAmicoUserImageUploadQuery, schemaHidAmicoUserPin, schemaHidAmicoUserPinParams, schemaHidAmicoVisitorImageParams, schemaHidAmicoVisitorImageUploadQuery, schemaHidAmicoVisitorQr, schemaHidPermissionCandidateQuery, schemaHidPermissionScopeQuery, schemaHidSipAccountRequest, schemaIncidentReport, schemaListNotification, schemaMultipleDocumentManagement, schemaNfcPatrolLog, schemaNfcPatrolRoute, schemaNfcPatrolTag, schemaNfcPatrolTagUpdateData, schemaNotification, schemaNotificationPreference, schemaNotificationPreferenceOff, schemaOccurrenceBook, schemaOccurrenceEntry, schemaOccurrenceSubject, schemaOnlineForm, schemaOvernightParkingApprovalHours, schemaOvernightParkingRequest, schemaPatrolEmail, schemaPatrolEmailCreatedBy, schemaPatrolEmailLogRef, schemaPatrolEmailQuery, schemaPatrolLog, schemaPatrolQuestion, schemaPatrolRoute, schemaPerson, schemaPlate, schemaPlatformTerms, schemaPost, schemaPostFavorite, schemaResendPatrolEmail, schemaResidentSelfSignUp, schemaSelfServiceVisitor, schemaSendPatrolEmail, schemaServiceProvider, schemaServiceProviderBilling, schemaSignNfcPatrolLog, schemaSiteCamera, schemaSiteFacility, schemaSiteFacilityBooking, schemaStatementOfAccount, schemaSubcategoryPreloved, schemaUnitBilling, schemaUpdateBidPreloved, schemaUpdateBuildingLevel, schemaUpdateBulletinBoard, schemaUpdateBulletinVideo, schemaUpdateCategoryPreloved, schemaUpdateChatPreloved, schemaUpdateDocumentManagement, schemaUpdateEntryPassSettings, schemaUpdateEventManagement, schemaUpdateFolderManagement, schemaUpdateFormEntry, schemaUpdateGuestManagement, schemaUpdateHidAmicoIdentity, schemaUpdateHidAmicoReader, schemaUpdateHidSitePermissions, schemaUpdateIncidentReport, schemaUpdateNotification, schemaUpdateNotificationPreference, schemaUpdateOccurrenceBook, schemaUpdateOccurrenceEntry, schemaUpdateOccurrenceSubject, schemaUpdateOnlineForm, schemaUpdateOptions, schemaUpdateOvernightParkingRequest, schemaUpdatePatrolLog, schemaUpdatePatrolQuestion, schemaUpdatePatrolRoute, schemaUpdatePerson, schemaUpdatePost, schemaUpdatePostFavorite, schemaUpdateServiceProviderBilling, schemaUpdateSiteBillingConfiguration, schemaUpdateSiteBillingItem, schemaUpdateSiteCamera, schemaUpdateSiteFacility, schemaUpdateSiteFacilityBooking, schemaUpdateSiteUnitBilling, schemaUpdateStatementOfAccount, schemaUpdateSubcategoryPreloved, schemaUpdateVisTrans, schemaVehicleTransaction, schemaVisitorTransaction, schemeCamera, schemeLogCamera, serviceProviderInviteLabel, sessionSchema, setIO, shiftSchema, siteSchema, site_people_namespace_collection, snapshotEndpoint, snapshotRefusalReason, stringifyHidJson, subscriptionPlanSchema, updateRemarksStatusEod, updateRemarksisAcknowledged, updateSiteSchema, useAccessManagementController, useAddressRepo, useAttendanceController, useAttendanceRepository, useAttendanceSettingsController, useAttendanceSettingsRepository, useAttendanceSettingsService, useAuthController, useAuthControllerV2, useAuthService, useAuthServiceV2, useBidPrelovedController, useBidPrelovedRepo, useBidPrelovedService, useBuildingController, useBuildingLevelController, useBuildingLevelRepo, useBuildingLevelService, useBuildingRepo, useBuildingService, useBuildingUnitController, useBuildingUnitRepo, useBuildingUnitService, useBulletinBoardController, useBulletinBoardRepo, useBulletinBoardService, useBulletinVideoController, useBulletinVideoRepo, useBulletinVideoService, useCameraViewController, useCameraViewService, useCategoryPrelovedController, useCategoryPrelovedRepo, useChannelPrelovedController, useChannelPrelovedRepo, useChatController, useChatPrelovedController, useChatPrelovedRepo, useChatPrelovedService, useChatRepo, useConsoleAuditController, useConsoleAuditRepo, useCounterModel, useCounterRepo, useCustomerController, useCustomerRepo, useCustomerSiteController, useCustomerSiteRepo, useCustomerSiteService, useDahuaService, useDashboardController, useDashboardRepo, useDocumentManagementController, useDocumentManagementRepo, useDocumentManagementService, useEntryPassSettingsController, useEntryPassSettingsRepo, useEventManagementController, useEventManagementRepo, useEventManagementService, useFeedbackController, useFeedbackRepo, useFeedbackService, useFileController, useFileRepo, useFileService, useFormEntryController, useFormEntryRepo, useGuestManagementController, useGuestManagementRepo, useGuestManagementService, useHidAmicoController, useHidAmicoRepo, useHidAmicoService, useHrmLabsAttendanceCtrl, useHrmLabsAttendanceSrvc, useIncidentReportController, useIncidentReportRepo, useIncidentReportService, useInvoiceController, useInvoiceModel, useInvoiceRepo, useManpowerDesignationCtrl, useManpowerDesignationRepo, useManpowerMonitoringCtrl, useManpowerMonitoringRepo, useManpowerMonitoringSrvc, useManpowerRemarkCtrl, useManpowerRemarksRepo, useManpowerSitesCtrl, useManpowerSitesRepo, useManpowerSitesSrvc, useMemberController, useMemberRepo, useMemberService, useNewDashboardController, useNewDashboardRepo, useNfcPatrolLogController, useNfcPatrolLogRepo, useNfcPatrolLogService, useNfcPatrolRouteController, useNfcPatrolRouteRepo, useNfcPatrolRouteService, useNfcPatrolSettingsController, useNfcPatrolSettingsRepository, useNfcPatrolSettingsService, useNfcPatrolTagController, useNfcPatrolTagRepo, useNfcPatrolTagService, useNotificationController, useNotificationPreferenceController, useNotificationPreferenceRepo, useNotificationPreferenceService, useNotificationRepo, useOccurrenceBookController, useOccurrenceBookRepo, useOccurrenceBookService, useOccurrenceEntryController, useOccurrenceEntryRepo, useOccurrenceEntryService, useOccurrenceSubjectController, useOccurrenceSubjectRepo, useOccurrenceSubjectService, useOnlineFormController, useOnlineFormRepo, useOrgController, useOrgControllerV2, useOrgRepo, useOvernightParkingController, useOvernightParkingRepo, useOvernightParkingRequestController, useOvernightParkingRequestRepo, useOvernightParkingRequestService, usePatrolEmailController, usePatrolEmailRepo, usePatrolEmailService, usePatrolLogController, usePatrolLogRepo, usePatrolLogService, usePatrolQuestionController, usePatrolQuestionRepo, usePatrolRouteController, usePatrolRouteRepo, usePersonController, usePersonRepo, usePlatformTermsController, usePlatformTermsRepo, usePlatformTermsService, usePostFavoriteController, usePostFavoriteRepo, usePostFavoriteService, usePostPrelovedController, usePostPrelovedRepo, usePriceController, usePriceModel, usePriceRepo, usePromoCodeController, usePromoCodeRepo, useRedDotPaymentController, useRedDotPaymentRepo, useRedDotPaymentSvc, useRobotController, useRobotRepo, useRobotService, useRoleController, useRoleControllerV2, useRoleRepo, useRoleRepoV2, useRoleServiceV2, useServiceProviderBillingController, useServiceProviderBillingRepo, useServiceProviderBillingService, useServiceProviderController, useServiceProviderInviteController, useServiceProviderInviteService, useServiceProviderRepo, useSessionRepo, useSiteBillingConfigurationController, useSiteBillingConfigurationRepo, useSiteBillingItemController, useSiteBillingItemRepo, useSiteCameraController, useSiteCameraRepo, useSiteCameraService, useSiteController, useSiteFacilityBookingController, useSiteFacilityBookingRepo, useSiteFacilityBookingService, useSiteFacilityController, useSiteFacilityRepo, useSiteFacilityService, useSiteRepo, useSiteService, useSiteUnitBillingController, useSiteUnitBillingRepo, useSiteUnitBillingService, useStatementOfAccountController, useStatementOfAccountRepo, useSubcategoryPrelovedController, useSubcategoryPrelovedRepo, useSubscriptionController, useSubscriptionPlanController, useSubscriptionPlanRepo, useSubscriptionRepo, useSubscriptionService, useUserController, useUserControllerV2, useUserRepo, useUserRepoV2, useUserService, useUserServiceV2, useVehicleController, useVehicleRepo, useVehicleService, useVerificationController, useVerificationControllerV2, useVerificationRepo, useVerificationRepoV2, useVerificationService, useVerificationServiceV2, useVisitorTransactionController, useVisitorTransactionRepo, useVisitorTransactionService, useWorkOrderController, useWorkOrderRepo, useWorkOrderService, userSchema, vehicleSchema, vehicles_namespace_collection, visitorPersonRepo, visitorPersonService, visitorType, visitors_namespace_collection, wallConfig, workOrderSchema, work_orders2_namespace_collection, work_orders_namespace_collection };
package/dist/index.js CHANGED
@@ -6315,6 +6315,7 @@ __export(src_exports, {
6315
6315
  schemaPlatformTerms: () => schemaPlatformTerms,
6316
6316
  schemaPost: () => schemaPost,
6317
6317
  schemaPostFavorite: () => schemaPostFavorite,
6318
+ schemaResendPatrolEmail: () => schemaResendPatrolEmail,
6318
6319
  schemaResidentSelfSignUp: () => schemaResidentSelfSignUp,
6319
6320
  schemaSelfServiceVisitor: () => schemaSelfServiceVisitor,
6320
6321
  schemaSendPatrolEmail: () => schemaSendPatrolEmail,
@@ -19389,10 +19390,28 @@ var schemaUpdateSiteCamera = import_joi20.default.object({
19389
19390
  then: import_joi20.default.required(),
19390
19391
  otherwise: import_joi20.default.optional().allow(null, "")
19391
19392
  }),
19392
- category: import_joi20.default.string().allow("standard", "resident", "visitor").required(),
19393
+ /**
19394
+ * `.valid()`, NOT `.allow()` - the same defect already fixed on `type` in
19395
+ * `schemaSiteCamera` below, on the two
19396
+ * remaining fields where the stored value is safe to constrain.
19397
+ *
19398
+ * `.allow()` whitelists ADDITIONAL values on a validator that already accepts
19399
+ * every string, so these three lines have never rejected anything. Measured
19400
+ * on the staging `site.cameras` collection (22 rows, 2026-08-26): `category`
19401
+ * is only ever standard|resident|visitor and `status` only ever
19402
+ * active|inactive, with no nulls, blanks or missing fields - and the only two
19403
+ * write callers in the estate (layer-common `CameraForm.vue` and
19404
+ * `iservice365-mobile-app-security`) offer exactly those values.
19405
+ *
19406
+ * `direction` is deliberately left on `.allow()`: `CameraForm.vue` also
19407
+ * offers "visitors" and "residents", which are outside the intended
19408
+ * entry|exit|both|none set, so constraining it would 400 two of the form's
19409
+ * own five options. That mismatch needs a product decision, not a schema edit.
19410
+ */
19411
+ category: import_joi20.default.string().valid("standard", "resident", "visitor").required(),
19393
19412
  guardPost: import_joi20.default.number().integer().optional(),
19394
19413
  direction: import_joi20.default.string().optional().allow("entry", "exit", "both", "none"),
19395
- status: import_joi20.default.string().optional().allow("active", "inactive", "deleted"),
19414
+ status: import_joi20.default.string().optional().valid("active", "inactive", "deleted"),
19396
19415
  name: import_joi20.default.string().optional().allow(null, "")
19397
19416
  });
19398
19417
  var schemaSiteCamera = import_joi20.default.object({
@@ -19425,10 +19444,11 @@ var schemaSiteCamera = import_joi20.default.object({
19425
19444
  * today. Every client in the estate already sends the lower-case pair.
19426
19445
  */
19427
19446
  type: import_joi20.default.string().trim().lowercase().valid("ip", "anpr").required(),
19428
- category: import_joi20.default.string().allow("standard", "resident", "visitor").required(),
19447
+ /** See the note on `schemaUpdateSiteCamera` for why `direction` stays as it is. */
19448
+ category: import_joi20.default.string().valid("standard", "resident", "visitor").required(),
19429
19449
  direction: import_joi20.default.string().required().allow("entry", "exit", "both", "none"),
19430
19450
  guardPost: import_joi20.default.number().integer().optional(),
19431
- status: import_joi20.default.string().optional().allow("active", "inactive", "deleted"),
19451
+ status: import_joi20.default.string().optional().valid("active", "inactive", "deleted"),
19432
19452
  name: import_joi20.default.string().optional().allow(null, ""),
19433
19453
  createdAt: import_joi20.default.date().optional(),
19434
19454
  updatedAt: import_joi20.default.date().optional(),
@@ -19687,7 +19707,18 @@ var schemaUpdateVisTrans = import_joi21.default.object({
19687
19707
  contact: import_joi21.default.string().optional().allow(null, "")
19688
19708
  })
19689
19709
  ).optional().allow(null),
19690
- updatedBy: import_joi21.default.string().hex().length(24).optional()
19710
+ updatedBy: import_joi21.default.string().hex().length(24).optional(),
19711
+ // Audit trail for the Approve/Reject action on a self-service submission -
19712
+ // `status` here drives the transition (and is mirrored onto the top-level
19713
+ // `status` field by the controller, since that's what list/report queries
19714
+ // filter on); `approvedBy`/`approvedAt`/`remarks` are kept nested so the
19715
+ // "who/when/why" doesn't crowd the top-level document shape.
19716
+ approval: import_joi21.default.object({
19717
+ approvedBy: import_joi21.default.string().hex().length(24).optional().allow(null, ""),
19718
+ status: import_joi21.default.string().valid("approved" /* APPROVED */, "rejected" /* REJECTED */).optional(),
19719
+ remarks: import_joi21.default.string().optional().allow(null, ""),
19720
+ approvedAt: import_joi21.default.date().iso().optional()
19721
+ }).optional()
19691
19722
  });
19692
19723
  function MVisitorTransaction(value) {
19693
19724
  const { error } = schemaVisitorTransaction.validate(value, {
@@ -50289,7 +50320,7 @@ function useVisitorTransactionService() {
50289
50320
  unitName: unit?.name,
50290
50321
  org: inviter?.org?.toString(),
50291
50322
  site: inviter?.site.toString(),
50292
- status: value?.type === "contractor" ? isAutoApprovedInvitation ? "approved" /* APPROVED */ : "Pending Approval" /* PENDING_APPROVAL */ : "Pending Approval" /* PENDING_APPROVAL */,
50323
+ status: value?.type === "contractor" ? isAutoApprovedInvitation ? "approved" /* APPROVED */ : "pending" /* PENDING */ : "pending" /* PENDING */,
50293
50324
  inviterId: userId
50294
50325
  };
50295
50326
  const leadId = new import_mongodb85.ObjectId();
@@ -50314,7 +50345,7 @@ function useVisitorTransactionService() {
50314
50345
  insertedIds.push(memberId);
50315
50346
  }
50316
50347
  }
50317
- const result = await _add({ ...payload, _id: leadId }, session);
50348
+ const result = await _add({ ...payload, _id: leadId.toString() }, session);
50318
50349
  insertedIds.push(result);
50319
50350
  await session?.commitTransaction();
50320
50351
  return insertedIds;
@@ -54614,10 +54645,13 @@ function useVisitorTransactionController() {
54614
54645
  return;
54615
54646
  }
54616
54647
  try {
54617
- const nextStatus = req.body.status;
54648
+ const approval = req.body.approval;
54649
+ const nextStatus = approval?.status ?? req.body.status;
54650
+ const remarks = approval?.remarks ?? req.body.remarks;
54618
54651
  const isApprovalTransition = nextStatus === "approved" /* APPROVED */ || nextStatus === "rejected" /* REJECTED */;
54619
54652
  const current = isApprovalTransition ? await _getVisitorTransactionById(_id) : null;
54620
- await _updateVisitorTransactionById(_id, req.body);
54653
+ const updateBody = approval ? { ...req.body, status: nextStatus } : req.body;
54654
+ await _updateVisitorTransactionById(_id, updateBody);
54621
54655
  if (isApprovalTransition && current && current.type === "guest" /* GUEST */ && current.email && current.status !== nextStatus) {
54622
54656
  try {
54623
54657
  if (nextStatus === "approved" /* APPROVED */) {
@@ -54652,7 +54686,7 @@ function useVisitorTransactionController() {
54652
54686
  handlebar: "self-service-visitor-rejected",
54653
54687
  context: {
54654
54688
  name: current.name,
54655
- remarks: req.body.remarks || ""
54689
+ remarks: remarks || ""
54656
54690
  }
54657
54691
  });
54658
54692
  await sendEmail({
@@ -54716,8 +54750,12 @@ function useVisitorTransactionController() {
54716
54750
  numberOfPassengers: import_joi65.default.number().integer().optional().allow(null, ""),
54717
54751
  purpose: import_joi65.default.string().optional().allow(null, ""),
54718
54752
  inviterUserId: import_joi65.default.string().hex().length(24).required(),
54719
- type: import_joi65.default.string().valid("contractor", "guest").optional().allow(null, ""),
54720
- contractorType: import_joi65.default.string().valid("home-contractor", "house-mover").optional().allow(null, ""),
54753
+ type: import_joi65.default.string().valid("contractor", "guest").required(),
54754
+ contractorType: import_joi65.default.string().valid("home-contractor", "house-mover").when("type", {
54755
+ is: "contractor",
54756
+ then: import_joi65.default.required(),
54757
+ otherwise: import_joi65.default.optional().allow(null, "")
54758
+ }),
54721
54759
  members: import_joi65.default.array().items(
54722
54760
  import_joi65.default.object({
54723
54761
  name: import_joi65.default.string().optional().allow(null, ""),
@@ -57624,17 +57662,46 @@ function usePatrolLogRepo() {
57624
57662
  }
57625
57663
  },
57626
57664
  { $unwind: { path: "$routeData", preserveNullAndEmptyArrays: true } },
57665
+ {
57666
+ // The most recent email that included this log, for the sent/failed
57667
+ // indicator. Matches `logs.log` on the snapshot stored with the email,
57668
+ // so it still resolves after the log itself is soft-deleted, and is
57669
+ // served by the `{ "logs.log": 1 }` index on patrol.emails.
57670
+ $lookup: {
57671
+ from: "patrol.emails",
57672
+ localField: "_id",
57673
+ foreignField: "logs.log",
57674
+ pipeline: [
57675
+ // A deleted email record is not an attempt anyone should see.
57676
+ { $match: { status: { $ne: "deleted" } } },
57677
+ { $sort: { createdAt: -1 } },
57678
+ { $limit: 1 },
57679
+ { $project: { _id: 1, status: 1, createdAt: 1 } }
57680
+ ],
57681
+ as: "lastEmailData"
57682
+ }
57683
+ },
57684
+ {
57685
+ $unwind: { path: "$lastEmailData", preserveNullAndEmptyArrays: true }
57686
+ },
57627
57687
  {
57628
57688
  // Flattened to match the `approvedByName` shape used elsewhere.
57629
57689
  // `repeat` is read live rather than snapshotted on the log: it is the
57630
57690
  // route's current configuration, so editing a route must change what
57631
57691
  // the list shows.
57692
+ //
57693
+ // `lastEmailStatus` is three-state on purpose — "sent", "failed", or
57694
+ // null when the log has never been emailed. A boolean cannot separate
57695
+ // "the last send failed" from "there was no send", and those need
57696
+ // different treatment on screen.
57632
57697
  $addFields: {
57633
57698
  createdByName: "$createdByData.name",
57634
- repeat: "$routeData.repeat"
57699
+ repeat: "$routeData.repeat",
57700
+ lastEmailStatus: { $ifNull: ["$lastEmailData.status", null] },
57701
+ lastEmailAt: { $ifNull: ["$lastEmailData.createdAt", null] }
57635
57702
  }
57636
57703
  },
57637
- { $project: { createdByData: 0, routeData: 0 } }
57704
+ { $project: { createdByData: 0, routeData: 0, lastEmailData: 0 } }
57638
57705
  ];
57639
57706
  const countPipeline = [
57640
57707
  {
@@ -58057,6 +58124,7 @@ var schemaPatrolEmail = import_joi77.default.object({
58057
58124
  }).optional().allow(null),
58058
58125
  sourceUrl: import_joi77.default.string().optional().allow("", null),
58059
58126
  status: import_joi77.default.string().valid("sent", "failed", "deleted").optional(),
58127
+ sourceEmail: import_joi77.default.string().hex().length(24).optional().allow(null, ""),
58060
58128
  createdBy: schemaPatrolEmailCreatedBy.required(),
58061
58129
  createdAt: import_joi77.default.string().optional().allow("", null),
58062
58130
  updatedAt: import_joi77.default.string().optional().allow("", null),
@@ -58075,6 +58143,12 @@ var schemaSendPatrolEmail = import_joi77.default.object({
58075
58143
  name: import_joi77.default.string().trim().max(200).required()
58076
58144
  }).required()
58077
58145
  });
58146
+ var schemaResendPatrolEmail = import_joi77.default.object({
58147
+ createdBy: import_joi77.default.object({
58148
+ _id: import_joi77.default.string().hex().length(24).required(),
58149
+ name: import_joi77.default.string().trim().max(200).required()
58150
+ }).required()
58151
+ });
58078
58152
  var schemaPatrolEmailQuery = import_joi77.default.object({
58079
58153
  site: import_joi77.default.string().hex().length(24).required(),
58080
58154
  // Optional: present for one patrol log's email history, absent for the
@@ -58109,6 +58183,9 @@ function MPatrolEmail(value) {
58109
58183
  if (value.createdBy && typeof value.createdBy._id === "string") {
58110
58184
  value.createdBy._id = toObjectId15(value.createdBy._id, "created by id");
58111
58185
  }
58186
+ if (value.sourceEmail && typeof value.sourceEmail === "string") {
58187
+ value.sourceEmail = toObjectId15(value.sourceEmail, "source email id");
58188
+ }
58112
58189
  if (value.pdf?.file && typeof value.pdf.file === "string") {
58113
58190
  value.pdf.file = toObjectId15(value.pdf.file, "pdf file id");
58114
58191
  }
@@ -58143,6 +58220,7 @@ function MPatrolEmail(value) {
58143
58220
  pdf: value.pdf ?? null,
58144
58221
  sourceUrl: value.sourceUrl ?? "",
58145
58222
  status: value.status ?? "sent",
58223
+ sourceEmail: value.sourceEmail ?? null,
58146
58224
  createdBy: {
58147
58225
  _id: value.createdBy._id,
58148
58226
  name: value.createdBy.name ?? ""
@@ -58181,7 +58259,9 @@ function usePatrolEmailRepo() {
58181
58259
  // "What have I sent?", and the rate-limit count.
58182
58260
  { key: { "createdBy._id": 1, createdAt: -1 } },
58183
58261
  // Answers "was this log ever emailed, and to whom?" without a scan.
58184
- { key: { "logs.log": 1 } }
58262
+ { key: { "logs.log": 1 } },
58263
+ // Finds the resends spawned from an original, newest first.
58264
+ { key: { sourceEmail: 1, createdAt: -1 } }
58185
58265
  ]);
58186
58266
  return `Successfully created indexes for ${namespace_collection}.`;
58187
58267
  } catch (error) {
@@ -58258,6 +58338,34 @@ function usePatrolEmailRepo() {
58258
58338
  throw new import_node_server_utils159.InternalServerError("Failed to attach the patrol email PDF.");
58259
58339
  }
58260
58340
  }
58341
+ async function withResendState(items, session) {
58342
+ const originals = items.filter((item) => !item.sourceEmail).map((item) => item._id);
58343
+ const children = originals.length ? await collection.find(
58344
+ {
58345
+ sourceEmail: { $in: originals },
58346
+ status: { $ne: "deleted" }
58347
+ },
58348
+ { session }
58349
+ ).project({ _id: 1, sourceEmail: 1, status: 1, createdAt: 1 }).sort({ createdAt: -1 }).toArray() : [];
58350
+ const byOriginal = /* @__PURE__ */ new Map();
58351
+ for (const child of children) {
58352
+ const key = String(child.sourceEmail);
58353
+ if (!byOriginal.has(key))
58354
+ byOriginal.set(key, []);
58355
+ byOriginal.get(key).push(child);
58356
+ }
58357
+ return items.map((item) => {
58358
+ const resends = byOriginal.get(String(item._id)) ?? [];
58359
+ const last = resends[0];
58360
+ return {
58361
+ ...item,
58362
+ isResend: Boolean(item.sourceEmail),
58363
+ resendCount: resends.length,
58364
+ // Sorted newest first above, so [0] is the most recent attempt.
58365
+ lastResend: last ? { _id: last._id, status: last.status, createdAt: last.createdAt } : null
58366
+ };
58367
+ });
58368
+ }
58261
58369
  async function getAll({
58262
58370
  site,
58263
58371
  log,
@@ -58287,7 +58395,12 @@ function usePatrolEmailRepo() {
58287
58395
  collection.find(query2, { session }).sort({ createdAt: -1, _id: -1 }).skip(page * limit).limit(limit).toArray(),
58288
58396
  collection.countDocuments(query2, { session })
58289
58397
  ]);
58290
- return (0, import_node_server_utils159.paginate)(items, page, limit, totalCount);
58398
+ return (0, import_node_server_utils159.paginate)(
58399
+ await withResendState(items, session),
58400
+ page,
58401
+ limit,
58402
+ totalCount
58403
+ );
58291
58404
  } catch (error) {
58292
58405
  import_node_server_utils159.logger.log({ level: "error", message: error.message });
58293
58406
  throw new import_node_server_utils159.InternalServerError("Failed to retrieve patrol emails.");
@@ -58308,7 +58421,8 @@ function usePatrolEmailRepo() {
58308
58421
  if (!data) {
58309
58422
  throw new import_node_server_utils159.NotFoundError("Patrol email not found.");
58310
58423
  }
58311
- return data;
58424
+ const [decorated] = await withResendState([data], session);
58425
+ return decorated;
58312
58426
  }
58313
58427
  async function markDeleted(_id, session) {
58314
58428
  const id = toId2(_id);
@@ -58622,6 +58736,80 @@ function usePatrolEmailService() {
58622
58736
  throw error;
58623
58737
  }
58624
58738
  }
58739
+ async function resend({
58740
+ id,
58741
+ createdBy,
58742
+ cookieHeader,
58743
+ appKey = "SECURITY"
58744
+ }) {
58745
+ const original = await _getById(id);
58746
+ if (original.status !== "failed") {
58747
+ throw new import_node_server_utils161.BadRequestError("Only a failed patrol email can be resent.");
58748
+ }
58749
+ if (original.sourceEmail) {
58750
+ throw new import_node_server_utils161.BadRequestError(
58751
+ "Resend the original email rather than a previous resend."
58752
+ );
58753
+ }
58754
+ await assertWithinRateLimit(createdBy._id);
58755
+ const snapshot = (original.logs ?? []).map((entry) => ({
58756
+ log: String(entry.log),
58757
+ name: entry.name ?? "",
58758
+ ...entry.route ? { route: String(entry.route) } : {},
58759
+ start: entry.start ?? "",
58760
+ end: entry.end ?? "",
58761
+ status: Array.isArray(entry.status) ? entry.status : []
58762
+ }));
58763
+ const record = await _add({
58764
+ site: String(original.site),
58765
+ subject: original.subject,
58766
+ recipients: original.recipients,
58767
+ logs: snapshot,
58768
+ logCount: snapshot.length,
58769
+ sourceUrl: original.sourceUrl,
58770
+ sourceEmail: String(original._id),
58771
+ createdBy
58772
+ });
58773
+ const recordId = String(record._id);
58774
+ try {
58775
+ let pdf = original.pdf?.url ? original.pdf : null;
58776
+ if (!pdf) {
58777
+ const pdfBuffer = await renderPagePdf({
58778
+ url: original.sourceUrl,
58779
+ title: "Patrol Log",
58780
+ cookieHeader,
58781
+ appKey
58782
+ });
58783
+ pdf = await storePdf(
58784
+ Buffer.from(pdfBuffer),
58785
+ `patrol-log-${recordId}.pdf`
58786
+ );
58787
+ }
58788
+ await _setPdf(recordId, pdf);
58789
+ const html = (0, import_node_server_utils161.compileHandlebar)({
58790
+ context: {
58791
+ dateRange: describeDateRange(snapshot),
58792
+ pdfUrl: pdf.url,
58793
+ logoUrl: `${STORAGE_API}/seven-365.svg`
58794
+ },
58795
+ filePath: (0, import_node_server_utils161.getDirectory)(__dirname, "./public/handlebars/patrol-log-email")
58796
+ });
58797
+ await mailer.sendMail({
58798
+ to: original.recipients.join(","),
58799
+ subject: original.subject,
58800
+ html,
58801
+ sender: "iService365"
58802
+ });
58803
+ return { ...record, _id: record._id, pdf, status: "sent" };
58804
+ } catch (error) {
58805
+ import_node_server_utils161.logger.log({
58806
+ level: "error",
58807
+ message: `Failed to resend patrol email ${recordId}: ${error.message}`
58808
+ });
58809
+ await _markFailed(recordId, sanitizeError(error)).catch(() => void 0);
58810
+ throw error;
58811
+ }
58812
+ }
58625
58813
  async function getAll(value) {
58626
58814
  return _getAll(value);
58627
58815
  }
@@ -58632,7 +58820,7 @@ function usePatrolEmailService() {
58632
58820
  await _markDeleted(id);
58633
58821
  return "Successfully deleted patrol email.";
58634
58822
  }
58635
- return { send: send2, getAll, getById, deleteById };
58823
+ return { send: send2, resend, getAll, getById, deleteById };
58636
58824
  }
58637
58825
 
58638
58826
  // src/controllers/patrol-email.controller.ts
@@ -58641,6 +58829,7 @@ var import_joi78 = __toESM(require("joi"));
58641
58829
  function usePatrolEmailController() {
58642
58830
  const {
58643
58831
  send: _send,
58832
+ resend: _resend,
58644
58833
  getAll: _getAll,
58645
58834
  getById: _getById,
58646
58835
  deleteById: _deleteById
@@ -58676,6 +58865,41 @@ function usePatrolEmailController() {
58676
58865
  return;
58677
58866
  }
58678
58867
  }
58868
+ async function resend(req, res, next) {
58869
+ const params = import_joi78.default.object({
58870
+ id: import_joi78.default.string().hex().length(24).required()
58871
+ }).validate({ id: req.params.id });
58872
+ if (params.error) {
58873
+ import_node_server_utils162.logger.log({ level: "error", message: `${params.error.message}` });
58874
+ next(new import_node_server_utils162.BadRequestError(params.error.message));
58875
+ return;
58876
+ }
58877
+ const { error, value } = schemaResendPatrolEmail.validate(req.body, {
58878
+ abortEarly: false
58879
+ });
58880
+ if (error) {
58881
+ const messages = error.details.map((d) => d.message).join(", ");
58882
+ import_node_server_utils162.logger.log({ level: "error", message: messages });
58883
+ next(new import_node_server_utils162.BadRequestError(messages));
58884
+ return;
58885
+ }
58886
+ try {
58887
+ const data = await _resend({
58888
+ id: params.value.id,
58889
+ createdBy: value.createdBy,
58890
+ // Only used when the original has no PDF to reuse and one has to be
58891
+ // rendered again.
58892
+ cookieHeader: req.headers.cookie,
58893
+ appKey: req.query.appKey || "SECURITY"
58894
+ });
58895
+ res.status(201).json({ message: "success", data });
58896
+ return;
58897
+ } catch (err) {
58898
+ import_node_server_utils162.logger.log({ level: "error", message: `${err.message}` });
58899
+ next(err);
58900
+ return;
58901
+ }
58902
+ }
58679
58903
  async function getAll(req, res, next) {
58680
58904
  const { error, value } = schemaPatrolEmailQuery.validate(req.query, {
58681
58905
  abortEarly: false
@@ -58733,7 +58957,7 @@ function usePatrolEmailController() {
58733
58957
  return;
58734
58958
  }
58735
58959
  }
58736
- return { send: send2, getAll, getById, deleteById };
58960
+ return { send: send2, resend, getAll, getById, deleteById };
58737
58961
  }
58738
58962
 
58739
58963
  // src/models/site-facility.model.ts
@@ -89173,6 +89397,7 @@ function useNotificationPreferenceController() {
89173
89397
  schemaPlatformTerms,
89174
89398
  schemaPost,
89175
89399
  schemaPostFavorite,
89400
+ schemaResendPatrolEmail,
89176
89401
  schemaResidentSelfSignUp,
89177
89402
  schemaSelfServiceVisitor,
89178
89403
  schemaSendPatrolEmail,