@7365admin1/core 3.136.2 → 3.137.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @iservice365/core
2
2
 
3
+ ## 3.137.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 7797946: SP invitations: Super Admin "Finish setup for invitee" (`GET/PUT /service-provider-invitations/:id/finish-setup`, `PUT .../finish-setup/undo`) creates the invitee's own company of the invited service (or uses the one it runs), links the site, accepts the invitation and points the account's default organisation at it, recorded and reversible. The wrong-join Repair also clears a default organisation that still points at the sender (Undo restores it). The typed company name is sanitised; accept-new-company returns the company and site names.
8
+
3
9
  ## 3.136.2
4
10
 
5
11
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -17520,6 +17520,9 @@ declare function useServiceProviderInviteController(): {
17520
17520
  wrongJoinPreview: (req: Request, res: Response, next: NextFunction) => Promise<void>;
17521
17521
  wrongJoinRepair: (req: Request, res: Response, next: NextFunction) => Promise<void>;
17522
17522
  wrongJoinUndo: (req: Request, res: Response, next: NextFunction) => Promise<void>;
17523
+ finishSetupPreview: (req: Request, res: Response, next: NextFunction) => Promise<void>;
17524
+ finishSetupApply: (req: Request, res: Response, next: NextFunction) => Promise<void>;
17525
+ finishSetupUndo: (req: Request, res: Response, next: NextFunction) => Promise<void>;
17523
17526
  linkSite: (req: Request, res: Response, next: NextFunction) => Promise<void>;
17524
17527
  received: (req: Request, res: Response, next: NextFunction) => Promise<void>;
17525
17528
  getOne: (req: Request, res: Response, next: NextFunction) => Promise<void>;
@@ -17684,6 +17687,13 @@ declare function inviteEmailFailureReason(error: any): string;
17684
17687
  declare function inviteResendWaitMinutes(history: Array<Record<string, any>> | null | undefined, now?: Date): number;
17685
17688
  /** The nature a company invited for this service is created with, or "". */
17686
17689
  declare function serviceProviderNatureFor(app?: string | null): string;
17690
+ /**
17691
+ * A company name typed by the invitee (sign-up form, sign-in-to-accept, or a
17692
+ * Super Admin finishing setup for them). Control characters and angle
17693
+ * brackets go, runs of whitespace become one space, 120 characters at most.
17694
+ * "" when nothing is left - the caller then falls back or refuses.
17695
+ */
17696
+ declare function sanitizeCompanyName(value: unknown): string;
17687
17697
 
17688
17698
  /**
17689
17699
  * May this caller send a service-provider invitation for `orgId` to `siteId`,
@@ -17855,7 +17865,9 @@ declare function useServiceProviderInviteService(): {
17855
17865
  }) => Promise<{
17856
17866
  orgId: string;
17857
17867
  nature: string;
17868
+ companyName: any;
17858
17869
  siteId: string;
17870
+ siteName: string;
17859
17871
  message: string;
17860
17872
  }>;
17861
17873
  wrongJoinPreview: ({ id, userId }: {
@@ -17896,6 +17908,49 @@ declare function useServiceProviderInviteService(): {
17896
17908
  message: string;
17897
17909
  changed: number;
17898
17910
  }>;
17911
+ finishSetupPreview: ({ id, userId, companyName, }: {
17912
+ id: string;
17913
+ userId?: string | undefined;
17914
+ companyName?: string | undefined;
17915
+ }) => Promise<{
17916
+ invitationId: string;
17917
+ email: string;
17918
+ account: string;
17919
+ service: string;
17920
+ serviceLabel: string;
17921
+ senderOrgName: string;
17922
+ siteName: string;
17923
+ companyName: string;
17924
+ usesExistingCompany: boolean;
17925
+ currentDefaultOrgName: string;
17926
+ status: string;
17927
+ canApply: boolean;
17928
+ blocked: string;
17929
+ applied: {
17930
+ at: any;
17931
+ by: any;
17932
+ orgId: any;
17933
+ companyName: any;
17934
+ } | null;
17935
+ }>;
17936
+ finishSetupApply: ({ id, userId, companyName, country, }: {
17937
+ id: string;
17938
+ userId?: string | undefined;
17939
+ companyName?: string | undefined;
17940
+ country?: string | undefined;
17941
+ }) => Promise<{
17942
+ message: string;
17943
+ orgId: string;
17944
+ companyName: string;
17945
+ nature: string;
17946
+ created: boolean;
17947
+ }>;
17948
+ finishSetupUndo: ({ id, userId }: {
17949
+ id: string;
17950
+ userId?: string | undefined;
17951
+ }) => Promise<{
17952
+ message: string;
17953
+ }>;
17899
17954
  linkSite: ({ id, userId, org, }: {
17900
17955
  id: string;
17901
17956
  userId?: string | undefined;
@@ -21447,4 +21502,4 @@ declare function usePersonalEmergencyChainController(): {
21447
21502
  update: (req: Request, res: Response, next: NextFunction) => Promise<void>;
21448
21503
  };
21449
21504
 
21450
- export { ANPRMode, APP_BASE_URLS, AUDIT_VALUE_MAX_LENGTH, AccessTypeProps, AppKey, AppServiceType, AssignCardConfig, BLOCKLIST_CATEGORIES, BULK_CAMERA_COLUMNS, BidStatus, BidType, BuildingLevelStatus, BuildingStatus, BulkCameraAccepted, BulkCameraOutcome, BulkCameraPlan, BulkCameraResult, 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_RECORDINGS_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, CONSOLE_PERMISSIONS, CONTRACTOR_TYPE_LABELS, CROSS_CLIENT_GRANT, CURRENT_TIME_ENDPOINT, Camera, CameraAddressInput, CameraCapability, CameraCapabilityContext, CameraCapabilityDescriptor, CameraCapabilityEntry, CameraCapabilityReason, CameraCapabilityState, CameraCapabilityTrace, CameraDevice, CameraFrame, CameraMembership, CameraStream, CameraTestStatus, CameraTransport, CameraType, ConsoleAuditAction, ConsoleAuditTarget, ConsoleGrant, DEFAULT_EMAIL_ALLOWLIST, DEFAULT_RING_SECONDS, DEFAULT_SCALE_M_PER_PX, DEFAULT_SITE_TIMEZONE, DEMO_ADD_MAX, DEMO_BRAND, DEMO_BRAND_DEFINITION, DEMO_CAPABILITIES, DEMO_FAULT_ROBOT, DEMO_ROUTES, DEVICE_STATUS, DISCONNECT, DOBStatus, DOOR_MODE, DRIVE_END_TEXT, DUPLICATE_TERMS_VERSION_MESSAGE, DayOfWeek, DeviceHttpTarget, DeviceProbeResult, DynamicFormFields, E164, EAccessCardTypes, EAccessCardUserTypes, EMAIL_CODE_MAX_ATTEMPTS, EMAIL_CODE_RESEND_MS, EMAIL_CODE_TTL_MS, EMAIL_PER_MODULE_PER_HOUR, EMAIL_WINDOW_MS, EmailSender, EntryOrder, EntrySort, EventOrder, EventSort, EventStatus, EventType, FLOOR_PLANS_TOTAL_MAX_BYTES, FLOOR_PLAN_MAX_BYTES, FacilitySort, FacilityStatus, FormEntryStatus, GOVERNED_MODULES, GuestSort, GuestStatus, HID_CARD_VALUE_FACTOR, HID_PERMISSION_CATEGORIES, HID_UINT32_MAX, HID_UINT64_MAX, HidRawUint64, IAccessCard, IAccessCardTransaction, INVITE_EMAIL_EVENTS, INVITE_RESEND_MIN_MINUTES, InviteActor, LIFT_DOOR, LIFT_LEASE_MS, LIFT_MODE, LIFT_MOTION, LIFT_QUEUE_TTL_MS, LIFT_REQUEST, LIFT_SESSION_STATUS, LIFT_SIM_BOARD_MS, LIFT_SIM_DOOR_DWELL_MS, LIFT_SIM_MS_PER_FLOOR, LIVE_ROLE, LIVE_VEHICLE_STATUSES, MANAGE_SITE_MODULES, MAX_BULK_CAMERA_ROWS, MAX_CAMERA_CHANNEL, MAX_CAMERA_NAME_LENGTH, MAX_PERSONAL_EMERGENCY_CONTACTS, MAX_RING_SECONDS, 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, MIN_RING_SECONDS, MIncidentReport, MManpowerDesignations, MManpowerMonitoring, MManpowerRemarks, MManpowerSites, MMember, MNfcPatrolLog, MNfcPatrolRoute, MNfcPatrolSettings, MNfcPatrolSettingsUpdate, MNfcPatrolTag, MNotification, MNotificationPreference, MODULE_GATE_MODE_DEFAULT, MODULE_LIST_GATE_DEFAULT, MOccurrenceBook, MOccurrenceEntry, MOccurrenceSubject, MOnlineForm, MOrg, MOvernightParkingApprovalHours, MOvernightParkingRequest, MPatrolEmail, MPatrolLog, MPatrolQuestion, MPatrolRoute, MPerson, MPersonalEmergencyChain, MPlatformTerms, MPost, MPostFavorite, MPromoCode, MQTT, MQTT_MAX_PACKET, MRobot, MRobotBuildingMap, MRole, MRoleV2, MServiceProvider, MServiceProviderBilling, MSession, MSite, MSiteCamera, MSiteFacility, MSiteFacilityBooking, MStatementOfAccount, MSubcategoryPreloved, MSubscription, MSubscriptionPlan, MUnitBilling, MUser, MVehicle, MVehicleTransaction, MVerification, MVerificationV2, MVisitorTransaction, MWorkOrder, MembershipPreference, NETWORK_STATES_MAX, NOTIFICATION_CATEGORIES, NOTIFICATION_CHANNELS, NOTIFICATION_CHANNEL_LABELS, NOTIFICATION_NAMESPACE, NOTIFY_ACCESS_FILTER_DEFAULT, NotificationAppSlug, NotificationCategory, NotificationChannel, NotificationModule, NotificationPreferenceView, NotificationService, OFFLINE_FAULT_CODE, OPEN_RMF_BRAND, OPEN_RMF_CAPABILITIES, OPEN_RMF_DISPLAY_NAME, ORG_MARKETPLACE_VENDOR_FIELD, ORG_OWNER_REPAIR_CLAIM_STALE_MS, ORG_OWNER_REPAIR_CLAIM_TAKEN_REASON, ORG_OWNER_REPAIR_DEFAULT, ORG_OWNER_REPAIR_OFF_REASON, OUNITECH_BRAND, OUNITECH_BRAND_DEFINITION, OUNITECH_CAPABILITIES, OUNITECH_FRESH_MS, OUNITECH_PENDING_COMMANDS, OUNITECH_REGION_BASE_URLS, OUNITECH_TIMESTAMP_FORMAT, OUNITECH_TIMESTAMP_SKEW_S, OUNITECH_TIMESTAMP_ZONE, OpenRmfError, OrgNature, OvernightParkingRequestSort, OvernightParkingRequestStatus, PADBOT_ACTION_TEXT, PADBOT_ALARMS, PADBOT_ALARM_POLL_MS, PADBOT_ALARM_READ_MS, PADBOT_ALARM_TEXT, PADBOT_ARRIVED_M, PADBOT_BRAND, PADBOT_BRAND_DEFINITION, PADBOT_CAPABILITIES, PADBOT_CHARGING, PADBOT_DISPLAY_NAME, PADBOT_FAILURE_SHOW_MS, PADBOT_LIVE_POSE_MS, PADBOT_MAKER_APP_ONLY, PADBOT_MODELS, PADBOT_MOTION, PADBOT_MOTION_MS, PADBOT_MOVED_M, PADBOT_MQTT_SYNC_MS, PADBOT_ONLINE_WINDOW_MS, PADBOT_OTHER_MAP_TEXT, PADBOT_PATHS, PADBOT_ROBOT_READ_MS, PATROL_CCTV_CAMERA_FILTER, PATROL_EMAIL_MAX_LOGS, PATROL_EMAIL_MAX_PER_HOUR, PATROL_EMAIL_MAX_RECIPIENTS, PERSON_TYPES, PINGREQ, PLAN_RANGE, PLATFORM_STAFF_MEMBER_TYPE, PLATFORM_STAFF_ROLE_TYPE, PLAYBACK_LINK_SECONDS, PLAYBACK_MAX_WINDOW_SECONDS, PROPERTY_MANAGEMENT_MEMBER_TYPES, PStatus, PTZ_ALLOWED_ACTIONS, PTZ_ALLOWED_CODES, Period, PersonStatus, PersonType, PersonTypes, PlatformTermsStatus, PostOrder, PostSort, PostStatus, QrTagProps, REALTIME_MAX_FANOUT, RECEIVED_INVITE_LABELS, RECEIVED_INVITE_TABS, REGISTERED_VEHICLE_CATEGORIES, ROBOT_APP_SCOPES, ROBOT_AUDIT_ACTIONS, ROBOT_CAPABILITIES, ROBOT_CLOUD_DOC_CONFIRMATIONS, ROBOT_CLOUD_PATHS, ROBOT_CLOUD_TIMEOUT_MS, ROBOT_CLOUD_TIMESTAMP_FORMATS, ROBOT_CREDENTIALS_ENV, ROBOT_MODULE, ROBOT_PERMISSIONS, ROBOT_STATUS_NAMES, ROBOT_TYPES, ReceivedInviteTab, ResidentAppModuleKey, RobotCloudError, RobotCredentialsError, SECRET_SETTING, SELF_SERVICE_RESEND_COOLDOWN_MS, SELF_SIGNUP_PLATFORM, SELF_SIGNUP_STATUS, SELF_SIGNUP_TYPES, SERVICE_PROVIDER_INVITE_EXPIRED_MESSAGE, 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, SERVICE_TYPE_LABELS, SITE_STATES_MAX, SOFTWARE_VERSION_ENDPOINT, SUBCONTRACT_ADMIN_REFUSAL, SUBCONTRACT_SITE_REFUSAL, ServiceProviderInviteAction, ServiceProviderInviteDecision, ServiceProviderInviteFacts, ServiceProviderInviteScope, ServiceProviderInviteScopeFacts, SiteAddress, SiteCategories, SiteStatus, SortFields, SortOrder, Status, SubjectOrder, SubjectSort, SubscriptionBillingMode, SubscriptionType, TAccessMngmntSettings, TActionStatus, TAdapterCommand, TAdapterRobot, TAddress, TAffectedEntities, TAffectedInjured, TAppServiceType, TApprovedBy, TApprover, TAreaColour, TAttendance, TAttendanceCheckIn, TAttendanceCheckOut, TAttendanceCheckTime, TAttendanceLocation, TAttendanceSettings, TAttendanceSettingsGetBySite, TAuthorities, TAuthoritiesCalled, TBidPreloved, TBilling, TBillingConfiguration, TBillingItem, TBuilding, TBuildingFloorPlan, TBuildingLevel, TBuildingMapDoor, TBuildingMapLevel, TBuildingMapLift, TBuildingUnit, TBulletinBoard, TBulletinVideo, TCamera, TCameraHealthClaim, TCategoryPreloved, TChannelPreloved, TChat, TChatPreloved, TCheckPoint$1 as TCheckPoint, TCleanLevel, TCleanMode, TCleanOptionValues, TCleanOptions, TCleanSubMode, TCloudArea, TCloudFile, TCloudHomeRobot, TCloudMap, TCloudPlan, TCloudPlanJob, TCloudProperty, TCloudRobot, TCloudRobotState, TCloudTaskState, TComplaintInfo, TComplaintReceivedTo, TConsoleAudit, TConsoleAuditQuery, TCounter, TCreateNfcPatrolLog, TCredentialField, TCrossSiteRoleMode, TCustomer, TCustomerSite, TCustomerSitePropertyField, TDayNumber, TDaySchedule, TDefaultAccessCard, TDesignations, TDocs, TDocumentCreate, TDocumentManagement, TDoorDriver, TDoorMode, TDoorRequest, TDoorState, TDriveSignal, TEntryPassSettings, TEventManagement, TFeedback, TFeedbackMetadata, TFeedbackUpdate, TFeedbackUpdateCategory, TFeedbackUpdateServiceProvider, TFeedbackUpdateStatus, TFeedbackUpdateToCompleted, TFile, TFiles, TFleetRobot, TFloorPlanLevel, TFloorPlanMap, TFloorSlab, TFolderUpdate, TFormEntry, TGetAttendancesByUserQuery, TGetAttendancesQuery, TGuestManagement, THidAmicoEvent, THidAmicoGatewayJob, THidAmicoIdentity, THidAmicoPhysicalCard, THidAmicoReader, THidPermissionAssignment, THidPermissionCategory, THidPermissionUserBinding, THidPhysicalCardInput, THidPhysicalCardType$1 as THidPhysicalCardType, THidSipAccount, THidSitePermissions, TIMESTAMP_OFFSET_CANDIDATES, TIncidentInformation, TIncidentReport, TIncidentTypeAndTime, TInviteEmailStatus, TInvoice, TKeyRef, TLevelSolids, TLiftDoorState, TLiftDriver, TLiftMode, TLiftMotionState, TLiftPhase, TLiftRequest, TLiftRequestType, TLiftSessionStatus, TLiftState, TManpowerDesignations, TManpowerDesignationsUpdate, TManpowerMonitoring, TManpowerMonitoringUpdate, TManpowerRemarks, TManpowerRemarksStatusUpdate, TManpowerRemarksUpdate, TManpowerSearchFilter, TManpowerSites, TMapDoor, TMapFloor, TMapMeasurement, TMapPointM, TMapSegment, TMapVertex, TMapWall, TMember, TMemberModulesDeps, TMemberUpdateStatus, TMessagePreloved, TMiniRole, TModuleAccess, TModuleGateMode, TModuleImpact, TMqttPacket, TNfcPatrolLog, TNfcPatrolRoute, TNfcPatrolRouteEdit, TNfcPatrolSettings, TNfcPatrolSettingsGetBySite, TNfcPatrolSettingsUpdate, TNfcPatrolTag, TNfcPatrolTagConfigureReset, TNfcPatrolTagEdit, TNfcPatrolTagUpdateData, TNotification, TNotificationEmail, TNotificationEmailJob, TNotificationEmailSettings, TNotificationPreference, TNotificationPreferenceOff, TNotifyAccessContext, TNotifyAccessMode, TNotifyAccessReport, TOccupancyGrid, TOccurrenceBook, TOccurrenceEntry, TOccurrenceSubject, TOnlineForm, TOpenRmfClient, TOpenRmfConfig, TOrg, TOrgModulesDeps, TOrgOwnerRepairClaim, TOrgOwnerRepairDeps, TOrgOwnerRepairInput, TOrgOwnerRepairPayload, TOrgOwnerRepairPlan, TOunitechMapView, TOunitechReading, TOunitechShape, TOvernightParkingApprovalHours, TOvernightParkingRequest, TPadbotDriveLimits, TPadbotLiveEvent, TPadbotMapFrame, TPadbotMotion, TPadbotMqttEvent, TPadbotMqttMessage, TPadbotPoint, TPatrolEmail, TPatrolEmailCreatedBy, TPatrolEmailLogRef, TPatrolLog, TPatrolQuestion, TPatrolRoute, TPendingCommand, TPerson, TPersonalEmergencyChain, TPersonalEmergencyContact, TPlaceOfIncident, TPlates, TPlatformTerms, TPost, TPostFavorite, TPreferenceViewOptions, TPrice, TPriceType, TPromoCode, TPromoCurrencyInput, TPromoTier, TRACKING_BACKOFF_BASE_MS, TRACKING_BACKOFF_CAP_MS, TRACKING_IDLE_TIMEOUT_MS, TRANSPORT_DEVICE_HTTP, TRANSPORT_RELAY_PLAYBACK, TRANSPORT_RELAY_PLAYER, TRANSPORT_RTSP_FRAME, TRecipientOfComplaint, TRegionProbe, TRemarks, TResident, TResidentAppModules, TRmfBuildingMap, TRmfFleetState, TRmfLocation, TRmfRobotState, TRobot, TRobotAction, TRobotAdapter, TRobotAppScope, TRobotBrand, TRobotBuildingMap, TRobotCapabilities, TRobotCapability, TRobotCleaning, TRobotCloudCredentials, TRobotCloudErrorKind, TRobotCloudPath, TRobotCloudReply, TRobotCloudReplyInfo, TRobotCloudTimestampFormat, TRobotCommand, TRobotDiagnosis, TRobotDiagnosisStep, TRobotInfo, TRobotLiftSession, TRobotLiveState, TRobotManifest, TRobotMetadata, TRobotMode, TRobotModelProfile, TRobotPage, TRobotPatrolCheckpoint, TRobotPatrolCheckpointVisit, TRobotPatrolPlan, TRobotPatrolRecord, TRobotPatrolRoute, TRobotPatrolScheduleRow, TRobotPermissionActor, TRobotPose, TRobotTier, TRobotType, TRole, TRolePermissionHistoryEntry, TRoleV2, TRoute, TSOABillingItem, TSOAStatus, TSelfServiceEmailOccasion, TSelfServiceEmailRecord, TSelfServiceResendDecision, TSelfServiceResendFacts, TServiceProvider, TServiceProviderBilling, TSession, TSessionCreate, TShifts, TSignNfcPatrolLog, TSite, TSiteCamera, TSiteDayBounds, TSiteFacility, TSiteFacilityBooking, TSiteInfo, TSiteInformation, TSiteMetadata, TSiteModulesDeps, TSiteProviderMember, TSiteUpdateBlock, TSseEvent, TStatementOfAccount, TSubcategoryPreloved, TSubmissionForm, TSubscription, TSubscriptionPlan, TSubscriptionPlanApplication, TTimestampOffsetProbe, TTimestampProbe, TTrackingEvent, TTrackingHandle, TUnitBilling, TUnits, TUpdateFormEntry, TUpdateName, TUser, TUserCreate, TVehicle, TVehicleAnprCamera, TVehicleFieldChange, TVehicleHistoryEntry, TVehicleTransaction, TVehicleUpdate, TVerification, TVerificationCode, TVerificationEvent, TVerificationMetadata, TVerificationMetadataV2, TVerificationOnboarding, TVerificationV2, TVisitorTransaction, TWallSolid, TWaterLevel, TWorkOrder, TWorkOrderMetadata, TWorkOrderUpdate, TWorkOrderUpdateStatus, TWorkOrderUpdateToCompleted, TanyoneDamageToProperty, UNSTORED_COLUMNS, UseAccessManagementRepo, UserStatus, VEHICLE_HISTORY_LIMIT, VERIFICATION_OPEN_STATUSES, VehicleCategory, VehicleListView, VehicleOrder, VehicleSort, VehicleStatus, VehicleType, VerificationLinkType, VerificationStatus, VerificationSubjectType, VerificationType, VisitorSort, VisitorStatus, WALL_HEIGHT_M, WALL_THICKNESS_M, adapterForRobot, addressSchema, allowedFieldsSite, allowedNatures, allowedPlanApplications, allowsRobotAction, allowsRobotListing, applyTrackingFrame, areaColourToHex, asList, assertServiceProviderInviteScope, attendanceSchema, attendanceSettingsSchema, buildSelfServiceEmailContext, buildingFileImportSchema, buildingFromRmf, buildingInPlanFrame, buildingMapBodySchema, buildingMapCreateSchema, buildingMapFromRobotMaps, buildingMapUpdateSchema, buildingSolids, building_level_namespace_collection, building_units_namespace_collection, buildings_namespace_collection, bulletin_boards_namespace_collection, callerAccountApproved, callerId, cameraBaseUrl, cameraCapabilitiesFor, cameraDevices, cameraGrant, cameraHealthClaim, cameraHealthSummary, cameraListClearConfirmation, cameraManagePermissions, cameraProbeCacheKey, cameraTransports, canManageSiteModules, canMonitorRobotType, canRevokeRefreshTokenFamily, canSetUpRobotType, categoriesForPermissions, categorySupportsChannel, chatPrelovedEvents, chatSchema, claimReadsAsStale, clampChassis, clampPtzSpeed, clearOunitechCaches, clearPadbotCache, clearRobotBrands, clockDriftSeconds, codeMatches, commandSupported, connackCode, consoleRoleAllows, consoleRoleAllowsAll, consoleSpellings, console_audit_namespace_collection, createDemoAdapter, createDriveWatchdog, createLiftSimulator, createManpowerRemarksDaily, createMessageDeduper, createMqttReader, createOpenRmfAdapter, createOpenRmfClient, createOunitechAdapter, createPadbotAdapter, createPadbotClient, createSseParser, crossSiteRoleGrants, crossSiteRoleMode, customerSchema, customerSitePropertyFields, decideSelfServiceResend, decideServiceProviderInvite, decodeHidPacsCard, decodePublish, decodeTrackingFrame, decryptCredential, deliverEmail, demoFault, demoPatrolPoint, deniedModules, deriveBulletinStatus, deriveCameraHost, derivedDemoRobot, describeCameraCapabilities, designationsSchema, deviceControlEnabled, deviceHttpEnabled, deviceHttpTargets, deviceHttpTimeoutMs, deviceProbeTtlSeconds, disconnectedState, doorModeOf, effectiveEmailAllowlist, emailOpenToEveryone, emitNotificationCreated, emptyPersonalEmergencyChain, encodeConnect, encodeGreyscalePng, encodeHidPacsCard, encodePuback, encodePublish, encodeSubscribe, encryptCredential, encryptedPairUpdate, endAllPadbotDrives, entitledSiteScope, escapeHtml, events_namespace_collection, expandModules, expiredBulletinSweepFilter, expiredVehicleSweepFilter, facility_bookings_namespace_collection, feedbackSchema, feedbacks2_namespace_collection, feedbacks_namespace_collection, fetchPadbotMqttCredentials, ffmpegFrameArgs, ffmpegPath, filterByAccess, filterSiteProviderMembers, fleetStateItem, floorNoOf, floorPlanBodySchema, flushNotificationEmails, forgetPadbotMaps, formatCapabilityTrace, formatDahuaDate, getIO, getSessionIdFromRequest, grabWithSubStreamFallback, greyscalePngDataUri, guests_namespace_collection, hasAnyCapability, hasAnyPermission, hasOrgInvitation, hasOrgOwnership, hasOrgSiteReach, hashCode, headParams, hexToAreaColour, hidRawUint64, holdsLift, holdsRole, incidentReport, incidentReportLog, incidents_namespace_collection, invitationOffersRole, inviteEmailFailureReason, inviteEmailStatus, inviteResendWaitMinutes, isAvailableForWork, isCameraEntitled, isCrossSiteRole, isDispatchable, isDoorPassable, isDuplicateMemberError, isDuplicateVersionError, isEmailAllowed, isEncryptedCredential, isLiftAvailable, isLikelySelfServiceEmail, isLiveVehicleStatus, isPatrolCctvCamera, isPlatformOwner, isProductionWebBase, isPromoCodeExpired, isRelayPlayerUrl, isSafeRelativePath, isSafeToCross, isSeasonPassVehicle, isServiceProviderInviteExpired, isSuperAdmin, isTermsCurrent, isTrackingStale, isValidTimezone, jcs, keepStoredPassword, levelPixelToMetres, levelScale, levelSolids, liftQueueKey, liftRequestSchema, listPadbotAlarmsSince, listStaffUserIds, liveStatusFor, logCamera, manpowerDesignationsSchema, manpowerEvents, manpowerMonitoringSchema, manpowerRemarksSchema, manpowerSitesSchema, mapWithLimit, maskNric, memberModulesHandlers, metresToPixel, missingForTier, moduleDeniedForCaller, moduleGateEnforceKeys, moduleGateMode, moduleImpact, moduleListGateOn, motionMessage, mqttBackoffMs, mqttRefreshDelayMs, networkText, newCode, newSecret, nfcPatrolSettingsSchema, nfcPatrolSettingsSchemaUpdate, normalisePatrolPlan, normalizeAcceptedTerms, normalizeEmail, normalizeHidCardValue, notificationAccessReport, notificationCategory, notificationCategoryLabel, notificationEmail, notificationEvents, notificationKind, notificationRoom, notifyAccessMode, notifyRobotFault, occasionForStatus, occurrence_book_namespace_collection, offLink, offPage, offToken, offTokenMatches, onBookTimezonesChanged, onPadbotLive, online_forms_namespace_collection, openLink, openRmfConfig, openRmfDoorDriver, openRmfLiftDriver, orgLevelRoles, orgModulesHandlers, orgOwnerRepairHandlers, orgOwnerRepairOn, orgQualifiesForOwnerRepair, orgRoleSets, orgSchema, ounitechAlertRecord, ounitechAppAction, ounitechCleaning, ounitechConsumable, ounitechCurrentMap, ounitechFault, ounitechFloorMapHistory, ounitechJobWords, ounitechMapShare, ounitechMapVersion, ounitechMapView, ounitechObstacleImage, ounitechPowerPlan, ounitechReadings, ounitechRobotFromHomeRow, ounitechSettings, ounitechShapes, ounitechStatusLog, ounitechTaskRecord, ounitechTime, ounitechTrack, overnight_parking_requests_namespace_collection, padbotAccountKey, padbotAlarmFault, padbotAlarmPlace, padbotAlarmPollEnabled, padbotBaseUrl, padbotCanReachMap, padbotChargingPoint, padbotCheckpointVisit, padbotCommandBlock, padbotCommandLog, padbotCurrentMap, padbotDriveBlock, padbotDriveLimits, padbotDriveSignal, padbotErrorText, padbotFailureText, padbotLinkUp, padbotLive, padbotManualDriveEnabled, padbotMode, padbotMotion, padbotMqttEnabled, padbotPatrolPlan, padbotPatrolRecord, padbotPlanShare, padbotReactionPoint, padbotReadiness, padbotSignature, padbotSignedRequest, parseCameraChannel, parseCameraHost, parseDahuaFind, parseDeviceTime, parseHidJsonLossless, parsePadbotAuthorization, parsePadbotMessage, parsePromoExpiry, parseRobotCommand, parseSoftwareVersion, pickAuditFields, pickCustomerSiteProperties, pinKey, pixelToMetres, planBulkCameraImport, planDayFromJsDay, planDemoRobots, planOrgOwnerRepair, planShareOf, platform_terms_namespace_collection, playbackRelays, playbackWindowRefusal, pngSize, promoCodeRefusal, promoCodeSchema, promoCodeStatusSchema, promoCodeUpdate, promoCodeUpdateSchema, ptzEndpoint, publicCameraFields, publishToPadbotRobot, queueNotificationEmails, readLiveItems, readPadbotStates, readPadbotStatesMany, readsAsApprovedAccount, receivedInviteTab, recordConsoleAction, recordPadbotLive, refuseServiceProviderInviteAction, registerCameraTransport, registerDemoBrand, registerOpenRmfBrand, registerOunitechBrand, registerPadbotBrand, registerRobotBrand, registeredRobotBrands, relayForRecorder, remarksSchema, renderPagePdf, requireConsolePermission, requirePlatformStaff, resetCameraTransports, residentAppModuleKeys, residentAppModulesSchema, residentFormEntry, resolutionRefusalReason, resolveCamera, resolveDeviceHttp, resolveHidPhysicalCardValue, resolveInviteActor, resolveSiteTimezone, resolveStaffRole, rmfBuilding_util as rmfBuilding, rmfBuildingSchema, robotActionsFor, robotBrandFor, robotCloudBody, robotCloudCredentials, robotCloudSign, robotCloudSigningString, robotCloudStepName, robotCloudTimestamp, robotCredentialsKey, robotFaultSweepConfig, robotManifest, robotMode, robotModeFromList, robotSchema, robotScopeForApp, robotTier, robotTypesVisibleTo, rtspUrl, safeTopic, scaleFromMeasurement, 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, schemaNotificationEmailAddress, schemaNotificationEmailCode, schemaNotificationEmailOff, schemaNotificationPreference, schemaNotificationPreferenceOff, schemaOccurrenceBook, schemaOccurrenceEntry, schemaOccurrenceSubject, schemaOnlineForm, schemaOvernightParkingApprovalHours, schemaOvernightParkingRequest, schemaPatrolEmail, schemaPatrolEmailCreatedBy, schemaPatrolEmailLogRef, schemaPatrolEmailQuery, schemaPatrolLog, schemaPatrolQuestion, schemaPatrolRoute, schemaPerson, schemaPersonalEmergencyContact, 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, schemaUpdatePersonalEmergencyChain, schemaUpdatePost, schemaUpdatePostFavorite, schemaUpdateServiceProviderBilling, schemaUpdateSiteBillingConfiguration, schemaUpdateSiteBillingItem, schemaUpdateSiteCamera, schemaUpdateSiteFacility, schemaUpdateSiteFacilityBooking, schemaUpdateSiteUnitBilling, schemaUpdateStatementOfAccount, schemaUpdateSubcategoryPreloved, schemaUpdateVisTrans, schemaVehicleTransaction, schemaVisitorTransaction, schemeCamera, schemeLogCamera, selectHealthTargets, selfServiceEmailSubject, sendNotificationEmails, servesFloor, serviceProviderInviteLabel, serviceProviderInviteScope, serviceProviderInviteViewStatus, serviceProviderInviterKind, serviceProviderNatureFor, serviceTypeLabel, sessionSchema, setIO, sha256Hex, shiftSchema, signLiveLink, signPlaybackLink, signedPath, simulatedLiftState, siteClientOrgs, siteDayBounds, siteInvitedPins, siteModulesHandlers, siteSchema, site_people_namespace_collection, snapshotEndpoint, snapshotRefusalReason, splitRobotSn, staffMayBypass, startDemoTracking, startPadbotDrive, startPadbotLiveFeed, startRobotTracking, startTodaysBookForSite, statesByType, stringifyHidJson, stripFacialImageMetadata, subackOk, subscriptionPlanSchema, summariseBulkCameraPlan, supports, taskRequestFor, toAdapterRobot, trackingBackoffMs, uncontrollableFleetWarning, 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, useOrgOwnerRepairRepo, useOrgRepo, useOvernightParkingController, useOvernightParkingRepo, useOvernightParkingRequestController, useOvernightParkingRequestRepo, useOvernightParkingRequestService, usePatrolEmailController, usePatrolEmailRepo, usePatrolEmailService, usePatrolLogController, usePatrolLogRepo, usePatrolLogService, usePatrolQuestionController, usePatrolQuestionRepo, usePatrolRouteController, usePatrolRouteRepo, usePersonController, usePersonRepo, usePersonalEmergencyChainController, usePersonalEmergencyChainRepo, usePersonalEmergencyChainService, usePlatformTermsController, usePlatformTermsRepo, usePlatformTermsService, usePostFavoriteController, usePostFavoriteRepo, usePostFavoriteService, usePostPrelovedController, usePostPrelovedRepo, usePriceController, usePriceModel, usePriceRepo, usePromoCodeController, usePromoCodeRepo, useRedDotPaymentController, useRedDotPaymentRepo, useRedDotPaymentSvc, useRobotBuildingMapRepo, useRobotCloudService, useRobotController, useRobotFaultRepo, useRobotFaultSweep, useRobotFleetController, useRobotFleetService, useRobotLiftSessionRepo, useRobotMapController, useRobotNetworkController, useRobotRepo, useRobotService, useRobotSiteController, 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, vehicleCategoryFor, vehicleHistoryEntry, vehicleHistoryValue, vehicleListViewQuery, vehicleSchema, vehicleViewOf, vehicles_namespace_collection, verificationEmail, vertexDistancePx, visitorPersonRepo, visitorPersonService, visitorType, visitors_namespace_collection, wallConfig, wallsFromOccupancyGrid, waypointsFor, webBase, withLiveLink, withNotificationKind, workOrderSchema, work_orders2_namespace_collection, work_orders_namespace_collection };
21505
+ export { ANPRMode, APP_BASE_URLS, AUDIT_VALUE_MAX_LENGTH, AccessTypeProps, AppKey, AppServiceType, AssignCardConfig, BLOCKLIST_CATEGORIES, BULK_CAMERA_COLUMNS, BidStatus, BidType, BuildingLevelStatus, BuildingStatus, BulkCameraAccepted, BulkCameraOutcome, BulkCameraPlan, BulkCameraResult, 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_RECORDINGS_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, CONSOLE_PERMISSIONS, CONTRACTOR_TYPE_LABELS, CROSS_CLIENT_GRANT, CURRENT_TIME_ENDPOINT, Camera, CameraAddressInput, CameraCapability, CameraCapabilityContext, CameraCapabilityDescriptor, CameraCapabilityEntry, CameraCapabilityReason, CameraCapabilityState, CameraCapabilityTrace, CameraDevice, CameraFrame, CameraMembership, CameraStream, CameraTestStatus, CameraTransport, CameraType, ConsoleAuditAction, ConsoleAuditTarget, ConsoleGrant, DEFAULT_EMAIL_ALLOWLIST, DEFAULT_RING_SECONDS, DEFAULT_SCALE_M_PER_PX, DEFAULT_SITE_TIMEZONE, DEMO_ADD_MAX, DEMO_BRAND, DEMO_BRAND_DEFINITION, DEMO_CAPABILITIES, DEMO_FAULT_ROBOT, DEMO_ROUTES, DEVICE_STATUS, DISCONNECT, DOBStatus, DOOR_MODE, DRIVE_END_TEXT, DUPLICATE_TERMS_VERSION_MESSAGE, DayOfWeek, DeviceHttpTarget, DeviceProbeResult, DynamicFormFields, E164, EAccessCardTypes, EAccessCardUserTypes, EMAIL_CODE_MAX_ATTEMPTS, EMAIL_CODE_RESEND_MS, EMAIL_CODE_TTL_MS, EMAIL_PER_MODULE_PER_HOUR, EMAIL_WINDOW_MS, EmailSender, EntryOrder, EntrySort, EventOrder, EventSort, EventStatus, EventType, FLOOR_PLANS_TOTAL_MAX_BYTES, FLOOR_PLAN_MAX_BYTES, FacilitySort, FacilityStatus, FormEntryStatus, GOVERNED_MODULES, GuestSort, GuestStatus, HID_CARD_VALUE_FACTOR, HID_PERMISSION_CATEGORIES, HID_UINT32_MAX, HID_UINT64_MAX, HidRawUint64, IAccessCard, IAccessCardTransaction, INVITE_EMAIL_EVENTS, INVITE_RESEND_MIN_MINUTES, InviteActor, LIFT_DOOR, LIFT_LEASE_MS, LIFT_MODE, LIFT_MOTION, LIFT_QUEUE_TTL_MS, LIFT_REQUEST, LIFT_SESSION_STATUS, LIFT_SIM_BOARD_MS, LIFT_SIM_DOOR_DWELL_MS, LIFT_SIM_MS_PER_FLOOR, LIVE_ROLE, LIVE_VEHICLE_STATUSES, MANAGE_SITE_MODULES, MAX_BULK_CAMERA_ROWS, MAX_CAMERA_CHANNEL, MAX_CAMERA_NAME_LENGTH, MAX_PERSONAL_EMERGENCY_CONTACTS, MAX_RING_SECONDS, 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, MIN_RING_SECONDS, MIncidentReport, MManpowerDesignations, MManpowerMonitoring, MManpowerRemarks, MManpowerSites, MMember, MNfcPatrolLog, MNfcPatrolRoute, MNfcPatrolSettings, MNfcPatrolSettingsUpdate, MNfcPatrolTag, MNotification, MNotificationPreference, MODULE_GATE_MODE_DEFAULT, MODULE_LIST_GATE_DEFAULT, MOccurrenceBook, MOccurrenceEntry, MOccurrenceSubject, MOnlineForm, MOrg, MOvernightParkingApprovalHours, MOvernightParkingRequest, MPatrolEmail, MPatrolLog, MPatrolQuestion, MPatrolRoute, MPerson, MPersonalEmergencyChain, MPlatformTerms, MPost, MPostFavorite, MPromoCode, MQTT, MQTT_MAX_PACKET, MRobot, MRobotBuildingMap, MRole, MRoleV2, MServiceProvider, MServiceProviderBilling, MSession, MSite, MSiteCamera, MSiteFacility, MSiteFacilityBooking, MStatementOfAccount, MSubcategoryPreloved, MSubscription, MSubscriptionPlan, MUnitBilling, MUser, MVehicle, MVehicleTransaction, MVerification, MVerificationV2, MVisitorTransaction, MWorkOrder, MembershipPreference, NETWORK_STATES_MAX, NOTIFICATION_CATEGORIES, NOTIFICATION_CHANNELS, NOTIFICATION_CHANNEL_LABELS, NOTIFICATION_NAMESPACE, NOTIFY_ACCESS_FILTER_DEFAULT, NotificationAppSlug, NotificationCategory, NotificationChannel, NotificationModule, NotificationPreferenceView, NotificationService, OFFLINE_FAULT_CODE, OPEN_RMF_BRAND, OPEN_RMF_CAPABILITIES, OPEN_RMF_DISPLAY_NAME, ORG_MARKETPLACE_VENDOR_FIELD, ORG_OWNER_REPAIR_CLAIM_STALE_MS, ORG_OWNER_REPAIR_CLAIM_TAKEN_REASON, ORG_OWNER_REPAIR_DEFAULT, ORG_OWNER_REPAIR_OFF_REASON, OUNITECH_BRAND, OUNITECH_BRAND_DEFINITION, OUNITECH_CAPABILITIES, OUNITECH_FRESH_MS, OUNITECH_PENDING_COMMANDS, OUNITECH_REGION_BASE_URLS, OUNITECH_TIMESTAMP_FORMAT, OUNITECH_TIMESTAMP_SKEW_S, OUNITECH_TIMESTAMP_ZONE, OpenRmfError, OrgNature, OvernightParkingRequestSort, OvernightParkingRequestStatus, PADBOT_ACTION_TEXT, PADBOT_ALARMS, PADBOT_ALARM_POLL_MS, PADBOT_ALARM_READ_MS, PADBOT_ALARM_TEXT, PADBOT_ARRIVED_M, PADBOT_BRAND, PADBOT_BRAND_DEFINITION, PADBOT_CAPABILITIES, PADBOT_CHARGING, PADBOT_DISPLAY_NAME, PADBOT_FAILURE_SHOW_MS, PADBOT_LIVE_POSE_MS, PADBOT_MAKER_APP_ONLY, PADBOT_MODELS, PADBOT_MOTION, PADBOT_MOTION_MS, PADBOT_MOVED_M, PADBOT_MQTT_SYNC_MS, PADBOT_ONLINE_WINDOW_MS, PADBOT_OTHER_MAP_TEXT, PADBOT_PATHS, PADBOT_ROBOT_READ_MS, PATROL_CCTV_CAMERA_FILTER, PATROL_EMAIL_MAX_LOGS, PATROL_EMAIL_MAX_PER_HOUR, PATROL_EMAIL_MAX_RECIPIENTS, PERSON_TYPES, PINGREQ, PLAN_RANGE, PLATFORM_STAFF_MEMBER_TYPE, PLATFORM_STAFF_ROLE_TYPE, PLAYBACK_LINK_SECONDS, PLAYBACK_MAX_WINDOW_SECONDS, PROPERTY_MANAGEMENT_MEMBER_TYPES, PStatus, PTZ_ALLOWED_ACTIONS, PTZ_ALLOWED_CODES, Period, PersonStatus, PersonType, PersonTypes, PlatformTermsStatus, PostOrder, PostSort, PostStatus, QrTagProps, REALTIME_MAX_FANOUT, RECEIVED_INVITE_LABELS, RECEIVED_INVITE_TABS, REGISTERED_VEHICLE_CATEGORIES, ROBOT_APP_SCOPES, ROBOT_AUDIT_ACTIONS, ROBOT_CAPABILITIES, ROBOT_CLOUD_DOC_CONFIRMATIONS, ROBOT_CLOUD_PATHS, ROBOT_CLOUD_TIMEOUT_MS, ROBOT_CLOUD_TIMESTAMP_FORMATS, ROBOT_CREDENTIALS_ENV, ROBOT_MODULE, ROBOT_PERMISSIONS, ROBOT_STATUS_NAMES, ROBOT_TYPES, ReceivedInviteTab, ResidentAppModuleKey, RobotCloudError, RobotCredentialsError, SECRET_SETTING, SELF_SERVICE_RESEND_COOLDOWN_MS, SELF_SIGNUP_PLATFORM, SELF_SIGNUP_STATUS, SELF_SIGNUP_TYPES, SERVICE_PROVIDER_INVITE_EXPIRED_MESSAGE, 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, SERVICE_TYPE_LABELS, SITE_STATES_MAX, SOFTWARE_VERSION_ENDPOINT, SUBCONTRACT_ADMIN_REFUSAL, SUBCONTRACT_SITE_REFUSAL, ServiceProviderInviteAction, ServiceProviderInviteDecision, ServiceProviderInviteFacts, ServiceProviderInviteScope, ServiceProviderInviteScopeFacts, SiteAddress, SiteCategories, SiteStatus, SortFields, SortOrder, Status, SubjectOrder, SubjectSort, SubscriptionBillingMode, SubscriptionType, TAccessMngmntSettings, TActionStatus, TAdapterCommand, TAdapterRobot, TAddress, TAffectedEntities, TAffectedInjured, TAppServiceType, TApprovedBy, TApprover, TAreaColour, TAttendance, TAttendanceCheckIn, TAttendanceCheckOut, TAttendanceCheckTime, TAttendanceLocation, TAttendanceSettings, TAttendanceSettingsGetBySite, TAuthorities, TAuthoritiesCalled, TBidPreloved, TBilling, TBillingConfiguration, TBillingItem, TBuilding, TBuildingFloorPlan, TBuildingLevel, TBuildingMapDoor, TBuildingMapLevel, TBuildingMapLift, TBuildingUnit, TBulletinBoard, TBulletinVideo, TCamera, TCameraHealthClaim, TCategoryPreloved, TChannelPreloved, TChat, TChatPreloved, TCheckPoint$1 as TCheckPoint, TCleanLevel, TCleanMode, TCleanOptionValues, TCleanOptions, TCleanSubMode, TCloudArea, TCloudFile, TCloudHomeRobot, TCloudMap, TCloudPlan, TCloudPlanJob, TCloudProperty, TCloudRobot, TCloudRobotState, TCloudTaskState, TComplaintInfo, TComplaintReceivedTo, TConsoleAudit, TConsoleAuditQuery, TCounter, TCreateNfcPatrolLog, TCredentialField, TCrossSiteRoleMode, TCustomer, TCustomerSite, TCustomerSitePropertyField, TDayNumber, TDaySchedule, TDefaultAccessCard, TDesignations, TDocs, TDocumentCreate, TDocumentManagement, TDoorDriver, TDoorMode, TDoorRequest, TDoorState, TDriveSignal, TEntryPassSettings, TEventManagement, TFeedback, TFeedbackMetadata, TFeedbackUpdate, TFeedbackUpdateCategory, TFeedbackUpdateServiceProvider, TFeedbackUpdateStatus, TFeedbackUpdateToCompleted, TFile, TFiles, TFleetRobot, TFloorPlanLevel, TFloorPlanMap, TFloorSlab, TFolderUpdate, TFormEntry, TGetAttendancesByUserQuery, TGetAttendancesQuery, TGuestManagement, THidAmicoEvent, THidAmicoGatewayJob, THidAmicoIdentity, THidAmicoPhysicalCard, THidAmicoReader, THidPermissionAssignment, THidPermissionCategory, THidPermissionUserBinding, THidPhysicalCardInput, THidPhysicalCardType$1 as THidPhysicalCardType, THidSipAccount, THidSitePermissions, TIMESTAMP_OFFSET_CANDIDATES, TIncidentInformation, TIncidentReport, TIncidentTypeAndTime, TInviteEmailStatus, TInvoice, TKeyRef, TLevelSolids, TLiftDoorState, TLiftDriver, TLiftMode, TLiftMotionState, TLiftPhase, TLiftRequest, TLiftRequestType, TLiftSessionStatus, TLiftState, TManpowerDesignations, TManpowerDesignationsUpdate, TManpowerMonitoring, TManpowerMonitoringUpdate, TManpowerRemarks, TManpowerRemarksStatusUpdate, TManpowerRemarksUpdate, TManpowerSearchFilter, TManpowerSites, TMapDoor, TMapFloor, TMapMeasurement, TMapPointM, TMapSegment, TMapVertex, TMapWall, TMember, TMemberModulesDeps, TMemberUpdateStatus, TMessagePreloved, TMiniRole, TModuleAccess, TModuleGateMode, TModuleImpact, TMqttPacket, TNfcPatrolLog, TNfcPatrolRoute, TNfcPatrolRouteEdit, TNfcPatrolSettings, TNfcPatrolSettingsGetBySite, TNfcPatrolSettingsUpdate, TNfcPatrolTag, TNfcPatrolTagConfigureReset, TNfcPatrolTagEdit, TNfcPatrolTagUpdateData, TNotification, TNotificationEmail, TNotificationEmailJob, TNotificationEmailSettings, TNotificationPreference, TNotificationPreferenceOff, TNotifyAccessContext, TNotifyAccessMode, TNotifyAccessReport, TOccupancyGrid, TOccurrenceBook, TOccurrenceEntry, TOccurrenceSubject, TOnlineForm, TOpenRmfClient, TOpenRmfConfig, TOrg, TOrgModulesDeps, TOrgOwnerRepairClaim, TOrgOwnerRepairDeps, TOrgOwnerRepairInput, TOrgOwnerRepairPayload, TOrgOwnerRepairPlan, TOunitechMapView, TOunitechReading, TOunitechShape, TOvernightParkingApprovalHours, TOvernightParkingRequest, TPadbotDriveLimits, TPadbotLiveEvent, TPadbotMapFrame, TPadbotMotion, TPadbotMqttEvent, TPadbotMqttMessage, TPadbotPoint, TPatrolEmail, TPatrolEmailCreatedBy, TPatrolEmailLogRef, TPatrolLog, TPatrolQuestion, TPatrolRoute, TPendingCommand, TPerson, TPersonalEmergencyChain, TPersonalEmergencyContact, TPlaceOfIncident, TPlates, TPlatformTerms, TPost, TPostFavorite, TPreferenceViewOptions, TPrice, TPriceType, TPromoCode, TPromoCurrencyInput, TPromoTier, TRACKING_BACKOFF_BASE_MS, TRACKING_BACKOFF_CAP_MS, TRACKING_IDLE_TIMEOUT_MS, TRANSPORT_DEVICE_HTTP, TRANSPORT_RELAY_PLAYBACK, TRANSPORT_RELAY_PLAYER, TRANSPORT_RTSP_FRAME, TRecipientOfComplaint, TRegionProbe, TRemarks, TResident, TResidentAppModules, TRmfBuildingMap, TRmfFleetState, TRmfLocation, TRmfRobotState, TRobot, TRobotAction, TRobotAdapter, TRobotAppScope, TRobotBrand, TRobotBuildingMap, TRobotCapabilities, TRobotCapability, TRobotCleaning, TRobotCloudCredentials, TRobotCloudErrorKind, TRobotCloudPath, TRobotCloudReply, TRobotCloudReplyInfo, TRobotCloudTimestampFormat, TRobotCommand, TRobotDiagnosis, TRobotDiagnosisStep, TRobotInfo, TRobotLiftSession, TRobotLiveState, TRobotManifest, TRobotMetadata, TRobotMode, TRobotModelProfile, TRobotPage, TRobotPatrolCheckpoint, TRobotPatrolCheckpointVisit, TRobotPatrolPlan, TRobotPatrolRecord, TRobotPatrolRoute, TRobotPatrolScheduleRow, TRobotPermissionActor, TRobotPose, TRobotTier, TRobotType, TRole, TRolePermissionHistoryEntry, TRoleV2, TRoute, TSOABillingItem, TSOAStatus, TSelfServiceEmailOccasion, TSelfServiceEmailRecord, TSelfServiceResendDecision, TSelfServiceResendFacts, TServiceProvider, TServiceProviderBilling, TSession, TSessionCreate, TShifts, TSignNfcPatrolLog, TSite, TSiteCamera, TSiteDayBounds, TSiteFacility, TSiteFacilityBooking, TSiteInfo, TSiteInformation, TSiteMetadata, TSiteModulesDeps, TSiteProviderMember, TSiteUpdateBlock, TSseEvent, TStatementOfAccount, TSubcategoryPreloved, TSubmissionForm, TSubscription, TSubscriptionPlan, TSubscriptionPlanApplication, TTimestampOffsetProbe, TTimestampProbe, TTrackingEvent, TTrackingHandle, TUnitBilling, TUnits, TUpdateFormEntry, TUpdateName, TUser, TUserCreate, TVehicle, TVehicleAnprCamera, TVehicleFieldChange, TVehicleHistoryEntry, TVehicleTransaction, TVehicleUpdate, TVerification, TVerificationCode, TVerificationEvent, TVerificationMetadata, TVerificationMetadataV2, TVerificationOnboarding, TVerificationV2, TVisitorTransaction, TWallSolid, TWaterLevel, TWorkOrder, TWorkOrderMetadata, TWorkOrderUpdate, TWorkOrderUpdateStatus, TWorkOrderUpdateToCompleted, TanyoneDamageToProperty, UNSTORED_COLUMNS, UseAccessManagementRepo, UserStatus, VEHICLE_HISTORY_LIMIT, VERIFICATION_OPEN_STATUSES, VehicleCategory, VehicleListView, VehicleOrder, VehicleSort, VehicleStatus, VehicleType, VerificationLinkType, VerificationStatus, VerificationSubjectType, VerificationType, VisitorSort, VisitorStatus, WALL_HEIGHT_M, WALL_THICKNESS_M, adapterForRobot, addressSchema, allowedFieldsSite, allowedNatures, allowedPlanApplications, allowsRobotAction, allowsRobotListing, applyTrackingFrame, areaColourToHex, asList, assertServiceProviderInviteScope, attendanceSchema, attendanceSettingsSchema, buildSelfServiceEmailContext, buildingFileImportSchema, buildingFromRmf, buildingInPlanFrame, buildingMapBodySchema, buildingMapCreateSchema, buildingMapFromRobotMaps, buildingMapUpdateSchema, buildingSolids, building_level_namespace_collection, building_units_namespace_collection, buildings_namespace_collection, bulletin_boards_namespace_collection, callerAccountApproved, callerId, cameraBaseUrl, cameraCapabilitiesFor, cameraDevices, cameraGrant, cameraHealthClaim, cameraHealthSummary, cameraListClearConfirmation, cameraManagePermissions, cameraProbeCacheKey, cameraTransports, canManageSiteModules, canMonitorRobotType, canRevokeRefreshTokenFamily, canSetUpRobotType, categoriesForPermissions, categorySupportsChannel, chatPrelovedEvents, chatSchema, claimReadsAsStale, clampChassis, clampPtzSpeed, clearOunitechCaches, clearPadbotCache, clearRobotBrands, clockDriftSeconds, codeMatches, commandSupported, connackCode, consoleRoleAllows, consoleRoleAllowsAll, consoleSpellings, console_audit_namespace_collection, createDemoAdapter, createDriveWatchdog, createLiftSimulator, createManpowerRemarksDaily, createMessageDeduper, createMqttReader, createOpenRmfAdapter, createOpenRmfClient, createOunitechAdapter, createPadbotAdapter, createPadbotClient, createSseParser, crossSiteRoleGrants, crossSiteRoleMode, customerSchema, customerSitePropertyFields, decideSelfServiceResend, decideServiceProviderInvite, decodeHidPacsCard, decodePublish, decodeTrackingFrame, decryptCredential, deliverEmail, demoFault, demoPatrolPoint, deniedModules, deriveBulletinStatus, deriveCameraHost, derivedDemoRobot, describeCameraCapabilities, designationsSchema, deviceControlEnabled, deviceHttpEnabled, deviceHttpTargets, deviceHttpTimeoutMs, deviceProbeTtlSeconds, disconnectedState, doorModeOf, effectiveEmailAllowlist, emailOpenToEveryone, emitNotificationCreated, emptyPersonalEmergencyChain, encodeConnect, encodeGreyscalePng, encodeHidPacsCard, encodePuback, encodePublish, encodeSubscribe, encryptCredential, encryptedPairUpdate, endAllPadbotDrives, entitledSiteScope, escapeHtml, events_namespace_collection, expandModules, expiredBulletinSweepFilter, expiredVehicleSweepFilter, facility_bookings_namespace_collection, feedbackSchema, feedbacks2_namespace_collection, feedbacks_namespace_collection, fetchPadbotMqttCredentials, ffmpegFrameArgs, ffmpegPath, filterByAccess, filterSiteProviderMembers, fleetStateItem, floorNoOf, floorPlanBodySchema, flushNotificationEmails, forgetPadbotMaps, formatCapabilityTrace, formatDahuaDate, getIO, getSessionIdFromRequest, grabWithSubStreamFallback, greyscalePngDataUri, guests_namespace_collection, hasAnyCapability, hasAnyPermission, hasOrgInvitation, hasOrgOwnership, hasOrgSiteReach, hashCode, headParams, hexToAreaColour, hidRawUint64, holdsLift, holdsRole, incidentReport, incidentReportLog, incidents_namespace_collection, invitationOffersRole, inviteEmailFailureReason, inviteEmailStatus, inviteResendWaitMinutes, isAvailableForWork, isCameraEntitled, isCrossSiteRole, isDispatchable, isDoorPassable, isDuplicateMemberError, isDuplicateVersionError, isEmailAllowed, isEncryptedCredential, isLiftAvailable, isLikelySelfServiceEmail, isLiveVehicleStatus, isPatrolCctvCamera, isPlatformOwner, isProductionWebBase, isPromoCodeExpired, isRelayPlayerUrl, isSafeRelativePath, isSafeToCross, isSeasonPassVehicle, isServiceProviderInviteExpired, isSuperAdmin, isTermsCurrent, isTrackingStale, isValidTimezone, jcs, keepStoredPassword, levelPixelToMetres, levelScale, levelSolids, liftQueueKey, liftRequestSchema, listPadbotAlarmsSince, listStaffUserIds, liveStatusFor, logCamera, manpowerDesignationsSchema, manpowerEvents, manpowerMonitoringSchema, manpowerRemarksSchema, manpowerSitesSchema, mapWithLimit, maskNric, memberModulesHandlers, metresToPixel, missingForTier, moduleDeniedForCaller, moduleGateEnforceKeys, moduleGateMode, moduleImpact, moduleListGateOn, motionMessage, mqttBackoffMs, mqttRefreshDelayMs, networkText, newCode, newSecret, nfcPatrolSettingsSchema, nfcPatrolSettingsSchemaUpdate, normalisePatrolPlan, normalizeAcceptedTerms, normalizeEmail, normalizeHidCardValue, notificationAccessReport, notificationCategory, notificationCategoryLabel, notificationEmail, notificationEvents, notificationKind, notificationRoom, notifyAccessMode, notifyRobotFault, occasionForStatus, occurrence_book_namespace_collection, offLink, offPage, offToken, offTokenMatches, onBookTimezonesChanged, onPadbotLive, online_forms_namespace_collection, openLink, openRmfConfig, openRmfDoorDriver, openRmfLiftDriver, orgLevelRoles, orgModulesHandlers, orgOwnerRepairHandlers, orgOwnerRepairOn, orgQualifiesForOwnerRepair, orgRoleSets, orgSchema, ounitechAlertRecord, ounitechAppAction, ounitechCleaning, ounitechConsumable, ounitechCurrentMap, ounitechFault, ounitechFloorMapHistory, ounitechJobWords, ounitechMapShare, ounitechMapVersion, ounitechMapView, ounitechObstacleImage, ounitechPowerPlan, ounitechReadings, ounitechRobotFromHomeRow, ounitechSettings, ounitechShapes, ounitechStatusLog, ounitechTaskRecord, ounitechTime, ounitechTrack, overnight_parking_requests_namespace_collection, padbotAccountKey, padbotAlarmFault, padbotAlarmPlace, padbotAlarmPollEnabled, padbotBaseUrl, padbotCanReachMap, padbotChargingPoint, padbotCheckpointVisit, padbotCommandBlock, padbotCommandLog, padbotCurrentMap, padbotDriveBlock, padbotDriveLimits, padbotDriveSignal, padbotErrorText, padbotFailureText, padbotLinkUp, padbotLive, padbotManualDriveEnabled, padbotMode, padbotMotion, padbotMqttEnabled, padbotPatrolPlan, padbotPatrolRecord, padbotPlanShare, padbotReactionPoint, padbotReadiness, padbotSignature, padbotSignedRequest, parseCameraChannel, parseCameraHost, parseDahuaFind, parseDeviceTime, parseHidJsonLossless, parsePadbotAuthorization, parsePadbotMessage, parsePromoExpiry, parseRobotCommand, parseSoftwareVersion, pickAuditFields, pickCustomerSiteProperties, pinKey, pixelToMetres, planBulkCameraImport, planDayFromJsDay, planDemoRobots, planOrgOwnerRepair, planShareOf, platform_terms_namespace_collection, playbackRelays, playbackWindowRefusal, pngSize, promoCodeRefusal, promoCodeSchema, promoCodeStatusSchema, promoCodeUpdate, promoCodeUpdateSchema, ptzEndpoint, publicCameraFields, publishToPadbotRobot, queueNotificationEmails, readLiveItems, readPadbotStates, readPadbotStatesMany, readsAsApprovedAccount, receivedInviteTab, recordConsoleAction, recordPadbotLive, refuseServiceProviderInviteAction, registerCameraTransport, registerDemoBrand, registerOpenRmfBrand, registerOunitechBrand, registerPadbotBrand, registerRobotBrand, registeredRobotBrands, relayForRecorder, remarksSchema, renderPagePdf, requireConsolePermission, requirePlatformStaff, resetCameraTransports, residentAppModuleKeys, residentAppModulesSchema, residentFormEntry, resolutionRefusalReason, resolveCamera, resolveDeviceHttp, resolveHidPhysicalCardValue, resolveInviteActor, resolveSiteTimezone, resolveStaffRole, rmfBuilding_util as rmfBuilding, rmfBuildingSchema, robotActionsFor, robotBrandFor, robotCloudBody, robotCloudCredentials, robotCloudSign, robotCloudSigningString, robotCloudStepName, robotCloudTimestamp, robotCredentialsKey, robotFaultSweepConfig, robotManifest, robotMode, robotModeFromList, robotSchema, robotScopeForApp, robotTier, robotTypesVisibleTo, rtspUrl, safeTopic, sanitizeCompanyName, scaleFromMeasurement, 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, schemaNotificationEmailAddress, schemaNotificationEmailCode, schemaNotificationEmailOff, schemaNotificationPreference, schemaNotificationPreferenceOff, schemaOccurrenceBook, schemaOccurrenceEntry, schemaOccurrenceSubject, schemaOnlineForm, schemaOvernightParkingApprovalHours, schemaOvernightParkingRequest, schemaPatrolEmail, schemaPatrolEmailCreatedBy, schemaPatrolEmailLogRef, schemaPatrolEmailQuery, schemaPatrolLog, schemaPatrolQuestion, schemaPatrolRoute, schemaPerson, schemaPersonalEmergencyContact, 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, schemaUpdatePersonalEmergencyChain, schemaUpdatePost, schemaUpdatePostFavorite, schemaUpdateServiceProviderBilling, schemaUpdateSiteBillingConfiguration, schemaUpdateSiteBillingItem, schemaUpdateSiteCamera, schemaUpdateSiteFacility, schemaUpdateSiteFacilityBooking, schemaUpdateSiteUnitBilling, schemaUpdateStatementOfAccount, schemaUpdateSubcategoryPreloved, schemaUpdateVisTrans, schemaVehicleTransaction, schemaVisitorTransaction, schemeCamera, schemeLogCamera, selectHealthTargets, selfServiceEmailSubject, sendNotificationEmails, servesFloor, serviceProviderInviteLabel, serviceProviderInviteScope, serviceProviderInviteViewStatus, serviceProviderInviterKind, serviceProviderNatureFor, serviceTypeLabel, sessionSchema, setIO, sha256Hex, shiftSchema, signLiveLink, signPlaybackLink, signedPath, simulatedLiftState, siteClientOrgs, siteDayBounds, siteInvitedPins, siteModulesHandlers, siteSchema, site_people_namespace_collection, snapshotEndpoint, snapshotRefusalReason, splitRobotSn, staffMayBypass, startDemoTracking, startPadbotDrive, startPadbotLiveFeed, startRobotTracking, startTodaysBookForSite, statesByType, stringifyHidJson, stripFacialImageMetadata, subackOk, subscriptionPlanSchema, summariseBulkCameraPlan, supports, taskRequestFor, toAdapterRobot, trackingBackoffMs, uncontrollableFleetWarning, 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, useOrgOwnerRepairRepo, useOrgRepo, useOvernightParkingController, useOvernightParkingRepo, useOvernightParkingRequestController, useOvernightParkingRequestRepo, useOvernightParkingRequestService, usePatrolEmailController, usePatrolEmailRepo, usePatrolEmailService, usePatrolLogController, usePatrolLogRepo, usePatrolLogService, usePatrolQuestionController, usePatrolQuestionRepo, usePatrolRouteController, usePatrolRouteRepo, usePersonController, usePersonRepo, usePersonalEmergencyChainController, usePersonalEmergencyChainRepo, usePersonalEmergencyChainService, usePlatformTermsController, usePlatformTermsRepo, usePlatformTermsService, usePostFavoriteController, usePostFavoriteRepo, usePostFavoriteService, usePostPrelovedController, usePostPrelovedRepo, usePriceController, usePriceModel, usePriceRepo, usePromoCodeController, usePromoCodeRepo, useRedDotPaymentController, useRedDotPaymentRepo, useRedDotPaymentSvc, useRobotBuildingMapRepo, useRobotCloudService, useRobotController, useRobotFaultRepo, useRobotFaultSweep, useRobotFleetController, useRobotFleetService, useRobotLiftSessionRepo, useRobotMapController, useRobotNetworkController, useRobotRepo, useRobotService, useRobotSiteController, 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, vehicleCategoryFor, vehicleHistoryEntry, vehicleHistoryValue, vehicleListViewQuery, vehicleSchema, vehicleViewOf, vehicles_namespace_collection, verificationEmail, vertexDistancePx, visitorPersonRepo, visitorPersonService, visitorType, visitors_namespace_collection, wallConfig, wallsFromOccupancyGrid, waypointsFor, webBase, withLiveLink, withNotificationKind, workOrderSchema, work_orders2_namespace_collection, work_orders_namespace_collection };
package/dist/index.js CHANGED
@@ -759,6 +759,7 @@ __export(src_exports, {
759
759
  robotTypesVisibleTo: () => robotTypesVisibleTo,
760
760
  rtspUrl: () => rtspUrl,
761
761
  safeTopic: () => safeTopic,
762
+ sanitizeCompanyName: () => sanitizeCompanyName,
762
763
  scaleFromMeasurement: () => scaleFromMeasurement,
763
764
  schema: () => schema,
764
765
  schemaAppSlugNotification: () => schemaAppSlugNotification,
@@ -9824,6 +9825,9 @@ function serviceProviderNatureFor(app) {
9824
9825
  const nature = PROVIDER_NATURE_ALIASES[key] ?? key;
9825
9826
  return nature !== "property_management_agency" && SERVICE_TYPE_LABELS[nature] ? nature : "";
9826
9827
  }
9828
+ function sanitizeCompanyName(value) {
9829
+ return String(value ?? "").replace(/[\u0000-\u001f\u007f<>]/g, " ").replace(/\s+/g, " ").trim().slice(0, 120).trim();
9830
+ }
9827
9831
 
9828
9832
  // src/utils/invite-actor.util.ts
9829
9833
  var import_node_server_utils28 = require("@7365admin1/node-server-utils");
@@ -25555,10 +25559,36 @@ function useServiceProviderInviteService() {
25555
25559
  );
25556
25560
  }
25557
25561
  const user = await getUserById(actor.id).catch(() => null);
25558
- const name = String(companyName ?? "").trim() || String(invite.metadata?.name ?? "").trim() || String(user?.name ?? "").trim();
25562
+ const { orgId } = await createProviderCompany({
25563
+ invite,
25564
+ nature,
25565
+ user,
25566
+ companyName,
25567
+ country
25568
+ });
25569
+ const result = await accept({ id, userId: actor.id, org: orgId });
25570
+ return {
25571
+ ...result,
25572
+ orgId,
25573
+ nature,
25574
+ companyName: (await getOrgById(orgId).catch(() => null))?.name ?? "",
25575
+ siteId: invite.metadata?.siteId?.toString?.() ?? "",
25576
+ siteName: String(invite.metadata?.siteName ?? "")
25577
+ };
25578
+ }
25579
+ async function createProviderCompany({
25580
+ invite,
25581
+ nature,
25582
+ user,
25583
+ companyName,
25584
+ country
25585
+ }) {
25586
+ const inviteeId = String(user?._id ?? "");
25587
+ const name = sanitizeCompanyName(companyName) || sanitizeCompanyName(invite.metadata?.name) || sanitizeCompanyName(user?.name);
25559
25588
  if (!name)
25560
25589
  throw new import_node_server_utils61.BadRequestError("Enter your company's name.");
25561
25590
  const email = String(invite.email ?? "").trim().toLowerCase();
25591
+ const actor = { id: inviteeId };
25562
25592
  const orgId = String(
25563
25593
  await addOrg({
25564
25594
  name,
@@ -25600,15 +25630,9 @@ function useServiceProviderInviteService() {
25600
25630
  await useUserRepo().updateUserFieldById({ _id: actor.id, field: "defaultOrg", value: orgId }).catch(() => void 0);
25601
25631
  import_node_server_utils61.logger.log({
25602
25632
  level: "info",
25603
- message: `[sp-invite] invite=${id} new company org=${orgId} nature=${nature}`
25633
+ message: `[sp-invite] invite=${String(invite._id)} new company org=${orgId} nature=${nature}`
25604
25634
  });
25605
- const result = await accept({ id, userId: actor.id, org: orgId });
25606
- return {
25607
- ...result,
25608
- orgId,
25609
- nature,
25610
- siteId: invite.metadata?.siteId?.toString?.() ?? ""
25611
- };
25635
+ return { orgId, name };
25612
25636
  }
25613
25637
  async function wrongJoinContext(id, userId) {
25614
25638
  const actor = await actorFor(userId);
@@ -25677,7 +25701,8 @@ function useServiceProviderInviteService() {
25677
25701
  async function repairWrongJoin({ id, userId }) {
25678
25702
  const { actor, invite, senderOrg, user } = await wrongJoinContext(id, userId);
25679
25703
  const rows = await wrongJoinRows(invite, senderOrg, user);
25680
- if (!rows.length) {
25704
+ const defaultOrgIsSender = !!user?._id && String(user?.defaultOrg ?? "") === senderOrg;
25705
+ if (!rows.length && !defaultOrgIsSender) {
25681
25706
  return {
25682
25707
  message: "Nothing to repair: this account is not in the sender's organisation.",
25683
25708
  changed: 0
@@ -25686,12 +25711,15 @@ function useServiceProviderInviteService() {
25686
25711
  const { updateMemberStatus } = useMemberRepo();
25687
25712
  for (const row of rows)
25688
25713
  await updateMemberStatus(row._id, { status: "inactive" });
25714
+ if (defaultOrgIsSender)
25715
+ await setDefaultOrg(String(user._id), "");
25689
25716
  await _transition({
25690
25717
  id,
25691
25718
  from: [],
25692
25719
  event: {
25693
25720
  ...event("wrong-join-repaired", actor),
25694
- memberIds: rows.map((row) => row._id)
25721
+ memberIds: rows.map((row) => row._id),
25722
+ ...defaultOrgIsSender ? { defaultOrgWas: senderOrg } : {}
25695
25723
  }
25696
25724
  });
25697
25725
  import_node_server_utils61.logger.log({
@@ -25712,12 +25740,170 @@ function useServiceProviderInviteService() {
25712
25740
  const ids2 = (repaired.memberIds ?? []).filter((m) => import_mongodb56.ObjectId.isValid(m));
25713
25741
  for (const m of ids2)
25714
25742
  await updateMemberStatus(m, { status: "active" }).catch(() => 0);
25743
+ const { user } = await wrongJoinContext(id, userId);
25744
+ if (repaired.defaultOrgWas && user?._id && !String(user.defaultOrg ?? "")) {
25745
+ await setDefaultOrg(String(user._id), String(repaired.defaultOrgWas));
25746
+ }
25715
25747
  await _transition({ id, from: [], event: event("wrong-join-undone", actor) });
25716
25748
  return {
25717
25749
  message: `Undone: ${ids2.length} membership${ids2.length === 1 ? "" : "s"} active again.`,
25718
25750
  changed: ids2.length
25719
25751
  };
25720
25752
  }
25753
+ async function setDefaultOrg(userId, orgId) {
25754
+ if (!orgId) {
25755
+ await import_node_server_utils61.useAtlas.getDb()?.collection("users").updateOne(
25756
+ { _id: new import_mongodb56.ObjectId(userId) },
25757
+ { $unset: { defaultOrg: "" }, $set: { updatedAt: (/* @__PURE__ */ new Date()).toISOString() } }
25758
+ );
25759
+ await (0, import_node_server_utils61.useCache)("users").delNamespace().catch(() => void 0);
25760
+ return;
25761
+ }
25762
+ await useUserRepo().updateUserFieldById({ _id: userId, field: "defaultOrg", value: orgId }).catch(() => void 0);
25763
+ }
25764
+ async function finishSetupContext(id, userId) {
25765
+ const ctx = await wrongJoinContext(id, userId);
25766
+ const { invite, user, senderOrg } = ctx;
25767
+ const nature = serviceProviderNatureFor(invite.metadata?.app);
25768
+ const existing = user?._id && nature ? await getByCreatorAndNature(String(user._id), nature).catch(() => null) : null;
25769
+ const stillInSender = await wrongJoinRows(invite, senderOrg, user);
25770
+ let blocked = "";
25771
+ if (!user?._id) {
25772
+ blocked = "This email has no account yet. The invitee signs up from the invitation email.";
25773
+ } else if (!nature) {
25774
+ blocked = "This invitation does not say which service the company provides.";
25775
+ } else if (invite.deletedAt) {
25776
+ blocked = "This invitation was deleted by the sender.";
25777
+ } else if (invite.status === "awaiting-approval" /* AWAITING_APPROVAL */) {
25778
+ blocked = "Approve the invitation first.";
25779
+ } else if (invite.status !== "pending" /* PENDING */) {
25780
+ blocked = `This invitation is ${serviceProviderInviteLabel(invite.status)}, not waiting for an answer.`;
25781
+ } else if (isServiceProviderInviteExpired(invite)) {
25782
+ blocked = "This invitation has expired. Press Resend email first.";
25783
+ } else if (stillInSender.length) {
25784
+ blocked = "The account is still inside the sender's organisation. Press Check account, then Repair, first.";
25785
+ }
25786
+ return { ...ctx, nature, existing, blocked };
25787
+ }
25788
+ function lastFinishSetup(invite) {
25789
+ const history = invite.history ?? [];
25790
+ const last = [...history].reverse().find((e) => ["finish-setup-applied", "finish-setup-undone"].includes(e?.action));
25791
+ return last?.action === "finish-setup-applied" ? last : null;
25792
+ }
25793
+ async function finishSetupPreview({
25794
+ id,
25795
+ userId,
25796
+ companyName
25797
+ }) {
25798
+ const { invite, user, senderOrg, nature, existing, blocked } = await finishSetupContext(id, userId);
25799
+ const [sender, currentDefault] = await Promise.all([
25800
+ getOrgById(senderOrg).catch(() => null),
25801
+ user?.defaultOrg ? getOrgById(String(user.defaultOrg)).catch(() => null) : null
25802
+ ]);
25803
+ const applied = lastFinishSetup(invite);
25804
+ return {
25805
+ invitationId: id,
25806
+ email: String(invite.email ?? ""),
25807
+ account: user?._id ? String(user.name || user.email || "") : "",
25808
+ service: nature,
25809
+ serviceLabel: nature ? serviceTypeLabel(nature) : "",
25810
+ senderOrgName: String(sender?.name ?? ""),
25811
+ siteName: String(invite.metadata?.siteName ?? ""),
25812
+ companyName: existing ? String(existing.name ?? "") : sanitizeCompanyName(companyName) || sanitizeCompanyName(invite.metadata?.name) || sanitizeCompanyName(user?.name),
25813
+ usesExistingCompany: !!existing,
25814
+ currentDefaultOrgName: String(currentDefault?.name ?? ""),
25815
+ status: String(invite.status ?? ""),
25816
+ canApply: !blocked,
25817
+ blocked,
25818
+ applied: applied ? { at: applied.at, by: applied.byName, orgId: applied.orgId, companyName: applied.companyName } : null
25819
+ };
25820
+ }
25821
+ async function finishSetupApply({
25822
+ id,
25823
+ userId,
25824
+ companyName,
25825
+ country
25826
+ }) {
25827
+ const { actor, invite, user, nature, existing, blocked } = await finishSetupContext(id, userId);
25828
+ if (blocked)
25829
+ throw new import_node_server_utils61.BadRequestError(blocked);
25830
+ const defaultOrgWas = String(user.defaultOrg ?? "");
25831
+ let orgId = existing ? String(existing._id) : "";
25832
+ let name = existing ? String(existing.name ?? "") : "";
25833
+ if (!orgId) {
25834
+ ({ orgId, name } = await createProviderCompany({ invite, nature, user, companyName, country }));
25835
+ } else {
25836
+ await setDefaultOrg(String(user._id), orgId);
25837
+ }
25838
+ const result = await useCustomerSiteService().addViaInvite(
25839
+ id,
25840
+ { id: actor.id, name: actor.name },
25841
+ orgId
25842
+ );
25843
+ await _transition({
25844
+ id,
25845
+ from: [],
25846
+ event: {
25847
+ ...event("finish-setup-applied", actor),
25848
+ orgId,
25849
+ companyName: name,
25850
+ created: !existing,
25851
+ defaultOrgWas
25852
+ }
25853
+ });
25854
+ if (result.accepted)
25855
+ await notifyInviter(invite, true, name);
25856
+ const siteName = String(invite.metadata?.siteName ?? "");
25857
+ import_node_server_utils61.logger.log({
25858
+ level: "info",
25859
+ message: `[sp-invite] finish-setup invite=${id} org=${orgId} created=${!existing} by=${actor.id}`
25860
+ });
25861
+ return {
25862
+ message: `${name} is set up and linked to ${siteName || "the site"}.`,
25863
+ orgId,
25864
+ companyName: name,
25865
+ nature,
25866
+ created: !existing
25867
+ };
25868
+ }
25869
+ async function finishSetupUndo({ id, userId }) {
25870
+ const { actor, invite, user } = await wrongJoinContext(id, userId);
25871
+ const applied = lastFinishSetup(invite);
25872
+ if (!applied)
25873
+ throw new import_node_server_utils61.BadRequestError("There is no Finish setup to undo on this invitation.");
25874
+ const orgId = String(applied.orgId ?? "");
25875
+ const siteId = invite.metadata?.siteId?.toString?.() ?? "";
25876
+ const db2 = import_node_server_utils61.useAtlas.getDb();
25877
+ if (!db2 || !import_mongodb56.ObjectId.isValid(orgId))
25878
+ throw new import_node_server_utils61.BadRequestError("Nothing to undo.");
25879
+ if (import_mongodb56.ObjectId.isValid(siteId)) {
25880
+ await db2.collection("customer.sites").updateMany(
25881
+ { org: new import_mongodb56.ObjectId(orgId), site: new import_mongodb56.ObjectId(siteId), status: "active" },
25882
+ { $set: { status: "inactive", updatedAt: (/* @__PURE__ */ new Date()).toISOString() } }
25883
+ );
25884
+ await (0, import_node_server_utils61.useCache)("customer.sites").delNamespace().catch(() => void 0);
25885
+ }
25886
+ if (applied.created) {
25887
+ const { updateMemberStatus } = useMemberRepo();
25888
+ const members = await db2.collection("members").find({ org: { $in: [new import_mongodb56.ObjectId(orgId), orgId] }, status: "active" }).toArray();
25889
+ for (const m of members) {
25890
+ await updateMemberStatus(m._id.toString(), { status: "inactive" });
25891
+ }
25892
+ await useOrgRepo().updateStatusById(orgId, "deleted").catch(() => void 0);
25893
+ }
25894
+ if (user?._id && String(user.defaultOrg ?? "") === orgId) {
25895
+ await setDefaultOrg(String(user._id), String(applied.defaultOrgWas ?? ""));
25896
+ }
25897
+ await _transition({
25898
+ id,
25899
+ from: ["complete" /* COMPLETE */],
25900
+ to: "pending" /* PENDING */,
25901
+ event: event("finish-setup-undone", actor)
25902
+ });
25903
+ return {
25904
+ message: "Undone: the site is off the company's list and the invitation is open again."
25905
+ };
25906
+ }
25721
25907
  async function notifyInviter(invite, accepted, providerName) {
25722
25908
  try {
25723
25909
  const to = invite.metadata?.invitedBy?.toString?.() ?? "";
@@ -25931,6 +26117,9 @@ function useServiceProviderInviteService() {
25931
26117
  wrongJoinPreview,
25932
26118
  repairWrongJoin,
25933
26119
  undoWrongJoin,
26120
+ finishSetupPreview,
26121
+ finishSetupApply,
26122
+ finishSetupUndo,
25934
26123
  linkSite,
25935
26124
  listReceived,
25936
26125
  getForProvider,
@@ -101293,6 +101482,9 @@ function useServiceProviderInviteController() {
101293
101482
  wrongJoinPreview: _wrongJoinPreview,
101294
101483
  repairWrongJoin: _repairWrongJoin,
101295
101484
  undoWrongJoin: _undoWrongJoin,
101485
+ finishSetupPreview: _finishSetupPreview,
101486
+ finishSetupApply: _finishSetupApply,
101487
+ finishSetupUndo: _finishSetupUndo,
101296
101488
  linkSite: _linkSite,
101297
101489
  listReceived: _listReceived,
101298
101490
  getForProvider: _getForProvider
@@ -101500,6 +101692,35 @@ function useServiceProviderInviteController() {
101500
101692
  const wrongJoinPreview = wrongJoin("preview");
101501
101693
  const wrongJoinRepair = wrongJoin("repair");
101502
101694
  const wrongJoinUndo = wrongJoin("undo");
101695
+ function finishSetup(action) {
101696
+ return async (req, res, next) => {
101697
+ try {
101698
+ await requireConsolePermission(req, "sp-approvals", "approve-sp");
101699
+ const { error, value } = import_joi149.default.object({
101700
+ companyName: import_joi149.default.string().trim().max(200).optional().allow("", null),
101701
+ country: import_joi149.default.string().trim().max(100).optional().allow("", null)
101702
+ }).validate(action === "preview" ? req.query ?? {} : req.body ?? {}, {
101703
+ stripUnknown: true
101704
+ });
101705
+ if (error)
101706
+ throw new import_node_server_utils294.BadRequestError(`Invalid input: ${error.message}`);
101707
+ const args = {
101708
+ id: inviteId(req),
101709
+ userId: callerId5(req),
101710
+ companyName: value.companyName ?? "",
101711
+ country: value.country ?? ""
101712
+ };
101713
+ res.json(
101714
+ action === "preview" ? await _finishSetupPreview(args) : action === "apply" ? await _finishSetupApply(args) : await _finishSetupUndo(args)
101715
+ );
101716
+ } catch (error) {
101717
+ next(error);
101718
+ }
101719
+ };
101720
+ }
101721
+ const finishSetupPreview = finishSetup("preview");
101722
+ const finishSetupApply = finishSetup("apply");
101723
+ const finishSetupUndo = finishSetup("undo");
101503
101724
  async function linkSite(req, res, next) {
101504
101725
  try {
101505
101726
  res.json(
@@ -101554,6 +101775,9 @@ function useServiceProviderInviteController() {
101554
101775
  wrongJoinPreview,
101555
101776
  wrongJoinRepair,
101556
101777
  wrongJoinUndo,
101778
+ finishSetupPreview,
101779
+ finishSetupApply,
101780
+ finishSetupUndo,
101557
101781
  linkSite,
101558
101782
  received,
101559
101783
  getOne
@@ -108766,6 +108990,7 @@ function usePersonalEmergencyChainController() {
108766
108990
  robotTypesVisibleTo,
108767
108991
  rtspUrl,
108768
108992
  safeTopic,
108993
+ sanitizeCompanyName,
108769
108994
  scaleFromMeasurement,
108770
108995
  schema,
108771
108996
  schemaAppSlugNotification,