Members
(constant) addFamilyUpdate
Adds family updates to a new member when they join a family
Synchronizes family data (address, email, phone, accounts) from existing family members
to the newly added family member.
- Source:
(constant) addFilter
Add a filter to a list
- Source:
(constant) addFilter
Adds a filter to a target and executes the filtering logic
(constant) addGroupGuest
Erstellt eine Gastgruppe für eine Zielgruppe und übernimmt Mitglieder/Jobs als Gäste.
- Source:
(constant) addGuests
Fügt mehrere Gäste oder Gastgruppen zu einer Gruppe hinzu.
- Source:
(constant) addListAbo
Adds a list to the client's subscription
- Source:
(constant) addObjectAbo
Adds object subscriptions for a socket client
- Source:
(constant) addPersons
Helper function to add persons to an email
- Source:
(constant) addPersonsToEmail
Add persons to email
- Source:
(constant) addSingleGuest
Adds a single person as guest to a group
- Source:
(constant) addUpdateEntry
Sends an update message with the data to all clients monitoring an object
- Source:
(constant) addUpdateEntry
Sends an update message with the data to be updated to all clients monitoring an object with the specified UID.
- Source:
(constant) addUpdateList
Sends the UUID's of a List which needs to be updated in the client
- Source:
(constant) addUpdateList
Sends the UUID's of a List, which needs to be updated in the client
- Source:
(constant) ageUpdate
Updates the age (`dindex` field) of persons associated with a given root UID
- Source:
(constant) alternativeRoot
Alternative root finding logic when no specific organization is provided
- Source:
(constant) api :express.Express
Type:
- express.Express
- Source:
(constant) applyFilterToEmail
Apply filter to email
- Source:
(async, constant) authorizeUser
The function retrieves all jobs associated with the user from the database,
applies the provided filter to these jobs, and determines if the user has
the necessary permissions to manage achievements for a person. This is used
to control who can add, modify, or delete achievement records based on their
job roles and permissions.
- Source:
(constant) broadcastUpdate
Broadcasts an update to all clients monitoring a specific list (by updateAbo)
- Source:
(constant) buildTranslateObject
Recursively builds a translation object by extracting content and label properties
from a serialized input object and its nested children. Ensures that existing entries
in the translation object are not overridden.
- Source:
Example
const serialized = {
component1: {
paras: { content: "Hello", label: "Greeting" },
children: [
{ component2: { paras: { content: "World", label: "Planet" } } }
]
}
};
const translateObject = {};
buildTranslateObject(serialized, translateObject);
console.log(translateObject); // { Hello: "Hello", Greeting: "Greeting", World: "World", Planet: "Planet" }
(constant) bulkAddGuests
Bulk add guests to a group
- Source:
(constant) checkEmailAdmin
Check if user is email admin
- Source:
(constant) checkExpire
Middleware to check file expiration parameters
- Source:
(constant) checkFamilies
Checks family consistency
- Source:
(constant) checkFileVisible
Middleware to check file visibility permissions
- Source:
(constant) checkGroupAdmin
Checks if the current user is admin for the group
- Source:
(constant) checkIsAdmin
Check if user is admin
(constant) checkRoot
Check and set the organization root for the current request
Uses Keycloak organization as single source of truth
- Source:
(constant) cleanFilters
Cleans unused filters
- Source:
(constant) cleanupSocketData
Cleans up all client data and buffers (e.g., on shutdown)
- Source:
(constant) clientDataStore :Map.<string, any>
Type:
- Map.<string, any>
- Source:
(constant) createAction
Create or update an action from a template and trigger
- Source:
(constant) createBirthdayFilter
re-assesses birthday filter
- Source:
(constant) createDB
Create a new database
Endpoint to initialize a new database schema.
Protected by employee rights.
(constant) createGuestGroup
Create guest group from existing group
- Source:
(constant) createOrChangeFamily
Create or change family membership (PUT /:famMember/:member)
Handles the creation or assignment of a family for a member.
Can create new families or assign members to existing families.
Supports rebate mode for family fee calculations.
- Source:
(constant) createOrUpdateAchievementTemplate
Creates or updates an achievement template
(constant) createOrUpdateActionTemplate
Create or update action template (PUT /)
(constant) createOrUpdateEmail
Create or update an email
- Source:
(constant) createOrUpdateExtern
Create or update external member (PUT /:group)
- Source:
(constant) createOrUpdateFilter
Create or update filter (PUT /:source/:target/:type)
* @param {ExpressRequestAuthorized} req - Express request object
* @param {ExpressResponse} res - Express response object
- Source:
(constant) createOrUpdatePerson
Creates or updates a person entry in the database
- Source:
(constant) debounceDelay :number
Type:
- number
- Source:
(constant) delayedUpdateTimestamps :Map.<string, number>
Type:
- Map.<string, number>
- Source:
(constant) deleteAchievement
This function deletes an achievement from the database. It performs the following steps:
1. Retrieves the achievement data using the provided UID
2. Checks if the user is authorized to delete the achievement
3. Deletes the achievement and related links from the database
4. Updates the achievement queue and list membership
5. Updates the client with the changes
Authorization is based on either template-defined filters or admin status.
- Source:
(constant) deleteAchievement
Deletes an achievement from the database
- Source:
(constant) deleteAchievementTemplate
Deletes an achievement template
(constant) deleteAction
Delete an action
- Source:
(constant) deleteActionTemplate
Delete action template (DELETE /:UID)
(constant) deleteActionTemplatesForBotNotInOrgs
Delete all action Templates for a specific bot, where the organizations are not in the provided list (DELETE /bot/:botUID)
(constant) deleteDirectory
Delete directory (DELETE /dir/:UID/:prefix)
- Source:
(constant) deleteEmail
Delete an email
- Source:
(constant) deleteEmailShare
Delete email share (delegate to list share function)
- Source:
(constant) deleteEntries
Delete entries function
(constant) deleteEvents
Deletes all events
(constant) deleteExtern
Delete external member (DELETE /:UID)
(constant) deleteFilter
Delete filters by source, target and type
- Source:
(constant) deleteFiltersByType
Delete filters by source, target and type (DELETE /:source/:target/:type)
- Source:
(constant) deleteGroup
Deletes a group (only if it has no members)
- Source:
(constant) deleteGuest
Delete a guest or guest group
- Source:
(constant) deleteJob
Deletes a job from the database.
- Source:
(constant) deleteLinks
Delete links for filters
(constant) deleteMultipleFiles
Delete multiple files (DELETE /:UID)
- Source:
(constant) deletePrivateRailFiles
Delete private rail files (DELETE /rail/:UID/:prefix/:filename)
- Source:
(constant) deletePublicFiles
Delete public files (DELETE /public/:expire/:prefix/:filename)
- Source:
(constant) deletePublicRailFiles
Delete public rail files (DELETE /rail/:app/:prefix/:filename)
- Source:
(constant) deleteSpecificFilter
Delete specific filter by UID (DELETE /:UID)
- Source:
(constant) doCheckVisible
Checks the visibility of a person and retrieves related job and member data
- Source:
(constant) execDListFilter
Executes a dynamic list filter (include/exclude/intersect) on a target list
(async, constant) expireAchievements
Expires achievements based on their renewal period
This function checks all achievements linked to a membership organization (root entity)
and expires those whose renewal period has elapsed. For each expired achievement,
it updates the dindex to mark it as expired and then updates the achievement lists
for affected persons.
- Source:
(constant) familyAddress
Synchronizes family-shared data (address, email, phone, accounts) across all family members
When a person/extern/family object is updated with family data, this function propagates
those changes to all other members of the same family. Handles:
- Family addresses
- Family email addresses
- Family phone numbers
- Family accounts (including familyFees accounts)
- Source:
(constant) generateMultipleUIDs
Generate multiple unique identifiers (UIDs)
(constant) generateUID
Generate a single unique identifier (UID)
(constant) getAchievement
Retrieves a specific achievement by UID
- Source:
(constant) getAchievementTemplates
Gets all achievement templates for the organization
(constant) getAchievements
Gets achievements for the organization
- Source:
(constant) getAchievementsDuplicates
Gets duplicate achievements
- Source:
(constant) getAchievementsTree
Gets achievements tree structure
- Source:
(constant) getAction
Get a specific action by UID
- Source:
(constant) getActionTemplate
Get specific action template (GET /:UID)
(constant) getActionTemplates
Get all action templates for organization (GET /)
(constant) getActionTemplatesForBot
Get all action templates for a specific bot (GET /bot/:botUID)
(constant) getActionsByTemplate
Get actions by template
- Source:
(constant) getActionsByTrigger
Get actions by trigger
- Source:
(constant) getAllEmailShares
Get all email shares (delegate to list share function)
- Source:
(constant) getAllFamilies
Get all families (GET /)
Administrative endpoint to retrieve all families.
Requires admin privileges.
- Source:
(constant) getAllFilters
Get all filters (GET /)
- Source:
(constant) getBulkFamilies
Bulk family retrieval (POST /families)
Retrieves family information for multiple UIDs at once.
Supports both current and historical data retrieval.
- Source:
(constant) getCachedUserData
Get user data from cache or members API
- Source:
(constant) getEmail
Get a specific email
- Source:
(constant) getEmailPersons
Get persons in email (with pagination support)
- Source:
(constant) getEmailShare
Get email share details (delegate to list share function)
- Source:
(constant) getEmailShares
Get email shares for specific list (delegate to list share function)
- Source:
(constant) getEmailsForPerson
Get emails for a person
- Source:
(constant) getEventLog
Gets event logs
- Source:
(constant) getEventParticipantLists
Manages event participant lists
- Source:
(constant) getEventVisibility
Rebuilds event visibility
- Source:
(constant) getExcludeObjects
Gets objects that match exclude/intersect filter criteria
(constant) getExtern
Get external member details (GET /:UID)
Delegates to the person controller since externs use the same data structure
(constant) getExternAdmin
Check admin rights for external member (GET /admin/:UID)
Delegates to the person controller since admin checks are the same
(constant) getExternDuplicates
Find duplicate external members (GET /duplicates/:firstName/:lastName)
Delegates to the person controller since duplicate detection logic is the same
(constant) getExternHistory
Get external member history (GET /history/:UID)
Delegates to the person controller since history tracking is the same
(constant) getFakeUser
Get fake user data for impersonation (admin only)
Uses Redis caching to avoid database queries on every API call
- Source:
(constant) getFamily
Get family information (GET /:UID)
Retrieves family data including current information or historical data for a specific year.
Supports fee calculation and historical data retrieval.
- Source:
(constant) getFamilyData
Gets family data or processes family corrections
- Source:
(constant) getFamilyListForGroup
Get family listing for a group (GET /list/:group)
Retrieves families associated with a specific group.
Supports pagination and various filtering options.
- Source:
(constant) getFamilyListing
Helper function to get family listing
Core function that builds family listings with various filtering and data options.
Supports historical data, person data inclusion, fee information, and visibility filtering.
- Source:
(constant) getFileWithPrefix
Get files with prefix (GET /:UID/:prefix/:filename)
- Source:
(constant) getFilter
Get specific filter by UID (GET /:UID)
- Source:
(constant) getFilterData
Gets filter data and source information for a filter
(constant) getFilters
Retrieves all filters for the supplied sources
(constant) getGroup
Gets group details with optional parent and sibling information
- Source:
(constant) getGroupGuests
Get all guests from a group
- Source:
(constant) getIncludeObjects
Gets objects that match include filter criteria
(constant) getListing
Get email listing (persons in email)
- Source:
(constant) getLogFiles
Get log files (GET /:api/logs)
- Source:
(constant) getMissedEventsByKey
Get missed events by key and timestamp
- Source:
(constant) getMissedEventsByKeys
Get missed events by multiple keys and timestamp
- Source:
(constant) getMissedEventsByPattern
Get missed events by pattern and timestamp
- Source:
(constant) getMissedEventsByTemplate
Get missed events by template and timestamp
- Source:
(constant) getMultipleActions
Get multiple actions by UIDs
- Source:
(async, constant) getObjects
Retrieves objects based on the provided ObjectUID(s).
This function queries the database to fetch objects and their associated data.
It supports both single ObjectUID and an array of ObjectUIDs. The returned data
includes details such as UID, type, associated member data, extra data, main base data,
title, and validity timestamps.
(constant) getOrganizationForGroup
Get the organization UID for a given group UID
- Deprecated:
- Use getOrganizationForObject instead (works for all object types due to link propagation)
- Source:
(constant) getOrganizationForList
Get the organization UID for a given list UID
Lists are NOT propagated, so we need: List → memberA → Group → member → Organization
Uses simplified organization detection with Data.root=true
- Source:
(constant) getOrganizationForObject
Get the organization UID for any PROPAGATED object UID (group, person, extern, job, guest)
Works because these object links are propagated to their organization via member links.
Link Propagation Flow:
Propagated Object → member link → ... → Organization (Data.root=true)
NOTE: Does NOT work for lists - use getOrganizationForList() instead
- Source:
(constant) getPaginatedFamilyList
Get paginated family listing (GET /list/:group with __page parameter)
Returns paginated family data for a group.
- Source:
(constant) getPendingEmails
Get pending emails (admin only)
- Source:
(constant) getPerson
Retrieves detailed information about a person, job, guest, or extern object
- Source:
(constant) getPrivateRailFiles
Get private rail files (GET /rail/:UID/:side/:filename)
- Source:
(constant) getPublicFiles
Get public files with expiration (GET /public/:expire/:UID/:filename)
- Source:
(constant) getPublicLanguageFiles
Get public language/config files (GET /:api/prefix1:(languages|config)/:filename/)
- Source:
(constant) getPublicRailFiles
Get public rail files (GET /rail/:app/:side/:filename)
- Source:
(constant) getQueueCount
Get the count of pending items in the processing queue
(constant) getSharedEmailData
Get shared email data (delegate to list shared function)
- Source:
(constant) getSingleFile
Get single file (GET /:UID/:filename)
- Source:
(constant) getTimestamp
Get current server timestamp
(constant) getTree
Rebuilds the membership tree for the given type
- Source:
(constant) getTypes
Determines what types of objects to select based on source type and filter
(constant) getUser
Get user object for the logged-in user for their organizations
Uses Redis caching to avoid database queries on every API call with Bearer auth
- Source:
(constant) getUsersWithVisibility
Get users who have specific visibility permissions for an entity
(constant) getUsersWithVisibilityData
Get users and their data who have specific visibility permissions for an entity
(constant) getVisibility
Rebuilds visibility settings for objects
- Source:
(constant) handleGroupMembershipMigration
Handles group membership migration for both person and extern types
- Source:
(constant) includeChangeability
Include changeability filter
(constant) includeVisibility
Include visibility filter
(constant) insertOrUpdateAchievement
Handles the insertion or update of an achievement for a member
- Source:
(constant) invalidateUserCache
Invalidate user cache for a specific user (call when user data changes)
- Source:
ioInstance :SocketIOServer|null
Type:
- SocketIOServer | null
- Source:
(constant) isAdmin
Check if user is admin for current organization
MIGRATION: Checks Keycloak orgRoles first, then falls back to database
- Source:
(constant) isAdminOrga
Check if user is admin for an organization
MIGRATION: Checks both Keycloak orgRoles (new) AND database admin list (legacy)
Once bot sync is complete, database check can be removed
- Source:
(constant) isBaseAdmin
Check if the base user (real user, not impersonated) has admin rights
MIGRATION: Checks Keycloak orgRoles first, then falls back to database
- Source:
isInitialized :boolean
Type:
- boolean
- Source:
(constant) isUserDataCached
Check if user data exists in cache
- Source:
(constant) isValidUID
Checks if the given UID is a valid UUID string with a specific prefix.
The UID must be a string that matches the following pattern:
- Starts with "UUID-"
- Follows the UUID version 1-5 format
- Source:
(constant) jobQualified
Checks if a person is qualified for a job based on their achievements.
- Source:
(constant) jobgroups
Returns job groups for a person with optional filtering
- Source:
(constant) listAchievementsPerson
Lists all achievements for a specific person
- Source:
(constant) listFiles
List files in directory (GET /:UID)
- Source:
(constant) matchExcludersList
Matches objects against excluder lists and handles membership updates
(constant) matchObjectsLists
Matches objects against list filters and updates dynamic lists accordingly
(constant) mergeTemplateData
Merges existing template data with new data, preserving customizations
- Source:
(constant) migrateDB
Migrates the database with pending migrations
- Source:
(constant) minTimestamp
Gets the minimum backdate timestamp for a group
- Source:
(constant) monitorDelayedUpdates
Monitors delayed updates and sends them if they're older than the threshold
Uses the global ioInstance to send updates
- Source:
(constant) optimizeDatabase
Optimizes database tables
- Source:
(constant) optimizeTables
Utility function to optimize database tables
- Source:
(constant) personAdmin
Checks if the logged-in user has admin rights for a given person UID
- Source:
(constant) personDuplicates
Finds potential duplicate person records based on phonetic similarity
- Source:
(constant) personHistorie
Retrieves the historical group membership information for a person
- Source:
(constant) preWarmUserCache
Pre-warm cache with commonly accessed users
- Source:
(constant) processExclude
Processes exclude filter operations
(constant) processInclude
Processes include filter operations
(constant) processIncludeFilter
Processes include filter and creates new entries based on filter criteria
(constant) processLastschrift
Processes SEPA mandate data for family fees
pubClient :redis.RedisClientType|null
Type:
- redis.RedisClientType | null
- Source:
(constant) publishChangeEvent
Publishes change events for person modifications.
Notifies related entities (groups, organizations) about changes to a person.
- Source:
(constant) publishEvent
Publishes an event to Redis with multi-tenant organization scoping
- Source:
(constant) publishGroupEvent
Publishes an event for a person joining or leaving an organization.
Notifies the group and its parent groups about the person's status change.
- Source:
(constant) putGroup
Creates or updates a group
- Source:
(constant) queueRunning :Record.<string, boolean>
Type:
- Record.<string, boolean>
- Source:
(async, constant) rebuildFeesGroup
Rebuilds the fees for all families that have a member in the specified group.
This has to be called, if the fees of a group have changed, so that all families with members in this group
will have their fees recalculated according to the new group fee rules.
- Source:
(constant) rebuildListEntries
Rebuilds list entries
- Source:
(constant) recreateJobsFunction
Recreates jobs based on a specified function template.
This function retrieves all jobs associated with a given function template
and recreates them based on the template using the recreateJobs function.
it should be called, when a function template is updated without changed to the achievement rules.
- Source:
(constant) recreateJobsGroup
Recreates all jobs within a specified group using templates.
This function fetches all job objects associated with a given group,
optionally at a specific point in time (using system versioning),
and recreates them based on their templates using the recreateJobs function.
this function should be called, when a group is updated.
- Source:
(constant) recreateJobsOrga
Recreates all jobs for an organization based on templates.
This function queries the database for all job objects belonging to the organization,
optionally as of a specific timestamp, and then recreates them. It retrieves related
data such as person, function, group, and member information needed for job recreation.
- Source:
(constant) recreateObjects
Recreates all objects of the organization of the given type via the template
- Source:
redisUrl :string
Type:
- string
- Source:
(constant) reduceFiltered
Reduces filtered results to unique entries by UIDBelongsTo
(constant) reduceObjects
Reduces duplicate objects to unique entries based on UIDBelongsTo comparison
(constant) regenerateEmbeddings
Regenerate AI embeddings for all objects of a specific type
Endpoint to regenerate embeddings for person, extern, guest, or job types.
Processes objects in batches with single API call per batch for cost efficiency.
(constant) registerBotActionTemplates
Register bot action templates (POST /register)
(constant) removeFilter
Removes a filter from a target and cleans up associated entries
(constant) removeMemberFromFamily
Remove member from family (DELETE /:UIDmember)
Removes a member from their current family and creates a new family for them.
Supports rebate mode for fee calculations.
- Source:
(constant) removePersonsFromEmail
Remove persons from email
- Source:
(constant) renewalMaintenance
Maintenance endpoint to check renewal of achievements
- Source:
(async, constant) requalify
Requalifies all jobs based on the given function template.
This function fetches all jobs related to the specified function template and updates their qualification status.
It also recreates the jobs with the updated qualification status.
This function should be called, when a function template including its achievement rules is updated.
- Source:
(constant) requalifyPersons
Requalifies all jobs based on function templates
- Source:
(constant) restartActionTemplate
Restart action template (POST /restart/:UID)
(constant) restorePerson
Restores a person from historical data
(constant) sendMessageBuffered
Sends a message to a client, buffering it if the client is not ready
- Source:
(constant) sendMessageBuffered
The function handles two types of messages:
1. Regular messages - Added to messageBuffer array
2. Update messages - Stored in updateBuffer, replacing any existing update
When connection is alive (ws.notAlive === 0):
- Sends current message if exists
- Sends any buffered update message
- Sends all buffered regular messages
- Source:
(constant) sendProgressStatus
Sends progress status to clients with matching root
- Source:
(constant) sendProgressStatus
Sends maintenance status to WebSocket clients with matching root organisation.
Used to update status of maintenance operations. in the admin app
- Source:
(constant) sendTransaction
Handles sending a transaction message to a specific client
- Source:
(constant) setOrgaRoot
Set the organization root for the current session
- Source:
(constant) setupSocketHandlers
Sets up Socket.IO event handlers
- Source:
(constant) shareEmail
Share email (delegate to list share function)
- Source:
(constant) suggestFamiliesByLastName
Suggest families by last name (GET /suggest/:lastName)
Provides family suggestions based on phonetic matching of last names.
Uses double metaphone algorithm for fuzzy matching and scoring.
- Source:
(constant) triggerMaintenance
Triggers the organisations tree queue
- Source:
(async, constant) updateAchievements
Consolidates all achievement UIDs for a person into their Data object.
This function fetches all achievements linked to a specific person, encodes their UIDs in base64 format,
and stores this consolidated array in the person's Data object. This approach enables faster filtering
and querying of persons based on their achievements without needing to perform complex joins each time.
The function only updates the person's record if the achievements data has actually changed,
minimizing unnecessary database operations.
- Source:
(constant) updateAction
Update an existing action
- Source:
(constant) updateConfig
Updates configuration for clients with matching root and app type
- Source:
(constant) updateConfig
Updates configuration for WebSocket clients with matching root organisation and matching app type
Is triggered when for this organisation the yaml configuration file is update
- Source:
(constant) updateEmail
Update email data
- Source:
(constant) updateExtern
Update external member data (POST /:UID)
Delegates to the person controller since data update logic is the same
(constant) updateFamily
Update family data (POST /:UID)
Updates family information including address, contact details, accounts, and fee address.
Handles both family-level updates and member-specific updates.
- Source:
(constant) updateGroup
Updates an existing group
- Source:
(constant) updateGroupMembership
Update group membership (POST /:group/:UID)
(constant) updateGroupMembership
Updates group membership for a person
- Source:
(constant) updateGroupMembershipShared
Shared function to update group membership for person or extern
- Source:
(constant) updatePerson
Updates a person's data in the database (partial update endpoint)
This endpoint (POST /:UID) performs partial data updates by merging the request body
with existing data. It only updates the Member table, not ObjectBase fields.
Used by both person and extern endpoints via delegation.
- Source:
(constant) updatePersonData
Updates person data in both ObjectBase and Member tables (full object update)
This function is used during create/update operations (PUT /:group) where a complete
object with all rendered fields is provided. It updates both database tables, handles
event publishing, family address updates, and WebSocket notifications.
Difference from updatePersonPartial:
- Updates BOTH ObjectBase and Member tables (vs. Member only)
- Expects a fully rendered object with Title, Display, SortBase, etc. (vs. partial data)
- Used for PUT operations during create/update flows (vs. POST for partial updates)
- Uses publishChangeEvent for group hierarchy (vs. direct publishEvent)
- Source:
(constant) updatePersonPartial
Updates person/extern data with partial merge (used by POST /:UID endpoint)
This function performs partial data updates by merging the provided data with existing
Member data. It only updates the Member table, not ObjectBase fields. Used by both
person and extern POST endpoints for partial updates without changing group membership.
Difference from updatePersonData:
- Updates ONLY Member table (vs. both ObjectBase and Member)
- Performs partial merge with existing data (vs. full object replacement)
- Uses direct publishEvent (vs. publishChangeEvent through group hierarchy)
- No group membership handling (vs. full create/update flow)
- Source:
(constant) updatePersonStatus
Update person status in email
- Source:
(constant) updateQueueStatus
Updates the queue status for all clients with matching root
- Source:
(constant) updateQueueStatus
Updates the queue status (no of opentasks in the queue loop) for WebSocket clients with matching root.
- Source:
(constant) updateTemplate
Sends an update template message to clients with matching root
- Source:
(constant) updateTemplate
Iterates through all WebSocket clients and sends an update template message
to those whose root organisation matches the provided root parameter (the organisation for which a template changes).
The message includes the root and current timestamp.
- Source:
(constant) updateTemplateEvent
Signals template change for the event app for clients with matching root
- Source:
(constant) updateTemplateEvent
Signals template change for the event app for connected WebSocket clients with matching root organisation.
Sends a buffered message containing the root and current timestamp to each matching client.
- Source:
(constant) uploadAvatarFiles
Upload avatar images (POST /avatar/:UID)
- Source:
(constant) uploadBannerFiles
Upload banner images (POST /banner/:UID)
- Source:
(constant) uploadEditorFiles
Upload editor files (POST /editor/:expire/:UID)
- Source:
(constant) uploadImagePdfFiles
Upload image and PDF files (POST /imagePdf/:UID)
- Source:
(constant) uploadLanguageOrChangelog
Upload language or changelog files (POST /:type(language|changelog)/:api)
- Source:
(constant) uploadPrivateFiles
Upload private files (POST /:UID)
- Source:
(constant) uploadPrivateRailFiles
Upload private rail files (POST /rail/:UID)
- Source:
(constant) uploadPublicFiles
Upload public files with expiration (POST /public/:expire/:UID)
- Source:
(constant) uploadPublicRailFiles
Upload public rail files for apps (POST /rail/:app/)
- Source:
(constant) validateRegisterInput
Validates input for register endpoint
- Source:
(constant) validateUser
Validate user access for an organization and populate cache
(constant) validateUserForOrganization
Validate user access to organization with caching
- Source:
(constant) visibilityFilter
Visibility filter function
(constant) visibilityList
Visibility list filter
(constant) wsFakeUser
Sends fake user data to clients associated with a specific user
- Source:
(async, constant) wsFakeUser
Sends fake user data to WebSocket clients associated with a specific user session
Is triggered when an administraor faking a login -simulating for himself being logged in as another user-
- Source:
Methods
(async) accountsReadOnly(req) → {Promise.<boolean>}
Checks if the current user has read-only access to group accounts
Parameters:
| Name | Type | Description |
|---|---|---|
req |
Object | Express request object |
- Source:
Returns:
True if accounts are read-only for this user
- Type
- Promise.<boolean>
(async) addAction(action)
Handles various actions related to adding objects to a tree structure, such as filters, memberships, visibility,
and other hierarchical updates. This function processes different types of actions and performs corresponding
database operations and updates.
Parameters:
| Name | Type | Description |
|---|---|---|
action |
treeAction | The action object containing details about the operation to be performed. |
- Source:
Throws:
-
Throws an error if any database operation or action processing fails.
- Type
- Error
(async) addAction()
- Source:
(async) adjustMemberData(member, object, organization) → {Promise.<(Object|undefined)>}
Adjusts member data with family-shared information (address, email, phone, accounts)
Parameters:
| Name | Type | Description |
|---|---|---|
member |
FamilyMemberObject | The family member to update |
object |
FamilyMemberObject | The source object containing family data |
organization |
string | Organization UID for event publishing |
- Source:
Returns:
Updated member data or undefined
- Type
- Promise.<(Object|undefined)>
app2serverURL(baseDir) → {object}
Combine OpenAPI documents by resolving $ref references
Parameters:
| Name | Type | Description |
|---|---|---|
baseDir |
string | Base directory for resolving references |
- Source:
Returns:
- Combined OpenAPI document
- Type
- object
avatarUrlGen()
URL generator for avatar file uploads
- Source:
bannerUrlGen()
URL generator for banner file uploads
- Source:
bufferToEmbedding(buffer) → {Float32Array}
Convert Buffer from database to Float32Array
Parameters:
| Name | Type | Description |
|---|---|---|
buffer |
Buffer | Binary buffer from DB |
- Source:
Returns:
- Embedding vector
- Type
- Float32Array
calculateContentHash(text) → {Buffer}
Calculate content hash for change detection
Parameters:
| Name | Type | Description |
|---|---|---|
text |
string | Text to hash |
- Source:
Returns:
- SHA256 hash
- Type
- Buffer
changelogUrlGen()
URL generator for changelog file uploads
- Source:
(async) checkEntries(ObjectUID, UIDOrga) → {Promise.<void>}
Checks all entries for the given objects against their filters and performs necessary cleanup.
This function processes multiple objects, retrieves their filters, and checks each entry
to ensure they still match the current filter criteria, removing entries that no longer qualify.
Parameters:
| Name | Type | Description |
|---|---|---|
ObjectUID |
Buffer | Array.<Buffer> | Single object UID or array of object UIDs to check |
UIDOrga |
string | The organization UUID for multi-tenant scoping (must be string) |
Throws:
Will log an error if any operation fails during execution.
Returns:
- Type
- Promise.<void>
(async) checkEntry(entry, UIDOrga)
Checks a single entry against its filters and performs necessary add/remove operations.
This function evaluates whether an entry should be included or excluded from a list based on
the current filter state and publishes appropriate events for membership changes.
Parameters:
| Name | Type | Description |
|---|---|---|
entry |
any | Entry object with filter information and membership data |
UIDOrga |
string | The unique identifier of the organization (required) |
Throws:
Will log an error if any operation fails during execution.
(async) checkPersonListMember(UID, UIDOrga) → {Promise.<void>}
Asynchronously checks if a person is a member of specific lists/dynamic lists dlist) and performs related operations.
This is clled, when an objet has been updated or created, to check if any dynamic list has to be updated
This function retrieves all groups (sources) that the object identified by the given UID is a member of,
matches the object against those lists, by checking all object filters attached to the sources/groups, if they pass the filters
and performs necessary updates to the entries of the dynamic lists attached to these filters
In a second step it checks, if therre are entries which do not match the filters anymore and removes them from the dlist
Parameters:
| Name | Type | Description |
|---|---|---|
UID |
string | Buffer | The unique identifier of the object to check membership for. |
UIDOrga |
string | The unique identifier of the organization. |
Throws:
Will log an error if any operation fails during execution.
Returns:
Resolves when the operations are completed.
- Type
- Promise.<void>
(async) cleanEventLog(timestampopt) → {Promise.<void>}
- Deletes events from the `eventLog` table where the `Timestamp` is older than the specified timestamp.
- If `timestamp` is `null`, the default value is calculated as the UNIX timestamp of the first day of the previous month.
- After deletion, the `eventLog` table is optimized to reclaim storage and improve performance.
- The database transaction is executed with a query timeout of 100 seconds.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
timestamp |
number | null |
<optional> |
null | The UNIX timestamp (in seconds) to use as the cutoff for deletion. Defaults to the first day of the previous month if not provided. |
- Source:
Throws:
-
Logs any errors encountered during the operation.
- Type
- Error
Returns:
Resolves when the cleanup operation is complete.
- Type
- Promise.<void>
compareDOWN(filterA, filterB) → {number}
Comparator function for sorting filters in descending order during filter removal.
Sorts by filter type priority: include > exclude > intersect (reverse order)
Parameters:
| Name | Type | Description |
|---|---|---|
filterA |
Object | First filter object with Type property |
filterB |
Object | Second filter object with Type property |
- Source:
Returns:
-1 if filterA < filterB, 0 if equal, 1 if filterA > filterB
- Type
- number
compareUP(filterA, filterB) → {number}
Comparator function for sorting filters in ascending order during filter rebuilding.
Sorts by filter type priority: include > exclude > intersect
Parameters:
| Name | Type | Description |
|---|---|---|
filterA |
Object | First filter object with Type property |
filterB |
Object | Second filter object with Type property |
- Source:
Returns:
-1 if filterA < filterB, 0 if equal, 1 if filterA > filterB
- Type
- number
cosineSimilarity(a, b) → {number}
Calculate cosine similarity between two embeddings
Parameters:
| Name | Type | Description |
|---|---|---|
a |
Float32Array | First embedding |
b |
Float32Array | Second embedding |
- Source:
Returns:
- Similarity score (0-1)
- Type
- number
(async) createNewExtern()
Helper function to create a new extern member
(async) createNewPerson()
Helper function to create a new person member
- Source:
decrypt(encryptedData, passphrase) → {string}
Decrypts an AES-128 encrypted Base64 string using a passphrase.
Parameters:
| Name | Type | Description |
|---|---|---|
encryptedData |
string | The encrypted string (Salt, IV, and encrypted text in Base64, separated by colons). |
passphrase |
string | The passphrase used to derive the decryption key and IV. |
- Source:
Returns:
- The decrypted Base64 string.
- Type
- string
(async) deleteDir()
Helper function to delete directories recursively
- Source:
(async) deleteFunctionTemplate(req, res) → {Promise.<void>}
Deletes a function template if there are no jobs linked to it.
This function checks if any jobs are associated with the specified function template.
If jobs are found, deletion is denied and a message is returned listing the members with jobs.
If no jobs are linked, the function template and all related achievement links are deleted.
The template update function is called after successful deletion.
Parameters:
| Name | Type | Description |
|---|---|---|
req |
Object | Express request object, expects `params.UID` for the template UID and `session.root` for the root user UID. |
res |
Object | Express response object used to send JSON responses. |
Returns:
Sends a JSON response indicating success or failure.
- Type
- Promise.<void>
deriveKeyAndIv(passphrase) → {Object}
Derives a key and IV from a passphrase.
Parameters:
| Name | Type | Description |
|---|---|---|
passphrase |
string | The passphrase to derive key and IV from. |
- Source:
Returns:
- The derived key, IV, and salt in base64 format.
- Type
- Object
embeddingToBuffer(embedding) → {Buffer}
Convert Float32Array to Buffer for database storage
Parameters:
| Name | Type | Description |
|---|---|---|
embedding |
Float32Array | Embedding vector |
- Source:
Returns:
- Binary buffer
- Type
- Buffer
encrypt(base64String, passphrase) → {string}
Encrypts a Base64-encoded string with AES-128 using a passphrase.
Parameters:
| Name | Type | Description |
|---|---|---|
base64String |
string | The Base64-encoded string to encrypt. |
passphrase |
string | The passphrase used to derive the encryption key and IV. |
- Source:
Returns:
- The encrypted string in Base64 format.
- Type
- string
(async) exclude(entry, UIDOrga)
Creates an exclusion link for an entry and publishes remove events to notify about the exclusion.
This function is called when an entry should be excluded from a list due to filter matching.
Parameters:
| Name | Type | Description |
|---|---|---|
entry |
any | Entry object containing UIDEntry, UIDList, UIDBelongsTo |
UIDOrga |
string | The unique identifier of the organization (required) |
Throws:
Will log an error if any operation fails during execution.
extractAchievements(filter) → {Array.<string>}
Extracts all achievement qualifiers (as strings) from a potentially nested filter object or array.
The function traverses the filter structure recursively, collecting all string values found at any depth.
The filter can be a string, an object with a single key whose value is another filter or array of filters, or an array of such filters.
Parameters:
| Name | Type | Description |
|---|---|---|
filter |
Object | Array | string | The filter structure to extract achievement qualifiers from. |
Returns:
An array of extracted achievement qualifier strings.
- Type
- Array.<string>
(async) fetchUserFromMembersAPI(userUID, orgaUID, authToken) → {Object}
Fetch user data from members API to populate cache
Parameters:
| Name | Type | Description |
|---|---|---|
userUID |
string | User UUID |
orgaUID |
string | Organization UUID |
authToken |
string | Auth token for API call |
- Source:
Returns:
- User data or null
- Type
- Object
filterImage()
Helper function to filter image file types
- Source:
filterImagePdf()
Helper function to filter image and PDF file types
- Source:
filterJSON()
Helper function to filter JSON file types
- Source:
generateEmbedding(text) → {Promise.<Float32Array>}
Generate single embedding from text
Parameters:
| Name | Type | Description |
|---|---|---|
text |
string | Text to embed |
- Source:
Returns:
- Embedding vector
- Type
- Promise.<Float32Array>
generateEmbeddings(texts) → {Promise.<Array.<Float32Array>>}
Generate embeddings from text using configured backend
Parameters:
| Name | Type | Description |
|---|---|---|
texts |
string | Array.<string> | Text(s) to embed |
- Source:
Returns:
- Array of embedding vectors
- Type
- Promise.<Array.<Float32Array>>
(async) generateEmbeddingsOllama()
Generate embeddings using Ollama
- Source:
(async) generateEmbeddingsOpenAI()
Generate embeddings using OpenAI
- Source:
(async) generateEmbeddingsTEI()
Generate embeddings using TEI (HuggingFace Text Embeddings Inference)
- Source:
(async) getAchievement(req, res) → {Promise.<void>}
Retrieves an achievement by UID, checking user permissions.
If timestamp is provided, retrieves the achievement as it was at that time.
Returns achievement details including template data and authorization status.
Parameters:
| Name | Type | Description | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
req |
Object | Express request object
Properties
|
||||||||||||||||||||||||||||||||
res |
Object | Express response object |
- Source:
Returns:
- Sends JSON response with achievement data or error message
- Type
- Promise.<void>
(async) getAllFilters(UID) → {Promise.<Array>}
Retrieves all filters (include, exclude, intersect) associated with a specific dynamic list.
Parameters:
| Name | Type | Description |
|---|---|---|
UID |
string | The unique identifier of the dynamic list |
- Source:
Returns:
Array of filter objects with UID, Type, Data, Title, Display, UIDBelongsTo, and SourceType
- Type
- Promise.<Array>
getEmbeddingServerInfo() → {Promise.<Object>}
Get embedding server info
- Source:
Returns:
- Type
- Promise.<Object>
(async) getFunctionTemplates(req, res) → {Promise.<void>}
Retrieves all function template names and UIDs for the organization.
Parameters:
| Name | Type | Description |
|---|---|---|
req |
Object | Express request object, expects `session.root` for the root user UID. |
res |
Object | Express response object used to send JSON responses. |
Returns:
Sends a JSON response with the function templates list.
- Type
- Promise.<void>
(async) getJobsByFunctionTemplate(req, res) → {Promise.<void>}
Retrieves jobs associated with a specific function template.
Parameters:
| Name | Type | Description |
|---|---|---|
req |
Object | Express request object, expects `params.UID` for the template UID and optional query parameters. |
res |
Object | Express response object used to send JSON responses. |
Returns:
Sends a JSON response with the jobs data.
- Type
- Promise.<void>
(async) getObjectFilters(ObjectUID) → {Promise.<(Array.<any>|undefined)>}
Retrieves all filters and related data for objects that need to be checked for dynamic list membership.
This function queries the database to get filter information for objects and their associated lists.
Parameters:
| Name | Type | Description |
|---|---|---|
ObjectUID |
Buffer | Array.<Buffer> | Single object UID or array of object UIDs to get filters for |
- Source:
Returns:
Array of filter objects with complete filter and object information
- Type
- Promise.<(Array.<any>|undefined)>
getRequiredDbRoles() → {Array.<string>}
Get the required database roles based on NODE_ENV
Production: db-user, db-admin
Development: db-dev, db-admin
Demonstration: db-demo, db-admin
- Source:
Returns:
Array of valid roles for current environment
- Type
- Array.<string>
(async) groupEntriesFilter(myObjectFilters) → {Promise.<(Record.<string, any>|undefined)>}
Groups filter data by entry UID and organizes filters into include/exclude/intersect categories.
This function processes raw filter data from the database and structures it for efficient
filtering operations, creating an object keyed by entry UIDs with complete filter information.
Parameters:
| Name | Type | Description |
|---|---|---|
myObjectFilters |
Array.<any> | Array of raw filter objects from the database query |
Throws:
Will log an error if any operation fails during execution.
Returns:
Object keyed by entry UIDs containing organized filter data
- Type
- Promise.<(Record.<string, any>|undefined)>
(async) handleSisterLink(req, UID) → {Promise.<(object|null)>}
Verarbeitet die Verknüpfung einer Gruppe mit einer "Schwestergruppe" (Sister Group).
Diese Funktion prüft, ob die aktuelle Gruppe (UID) mit einer anderen Gruppe (belongsTo) als Schwestergruppe verknüpft werden soll.
Falls sich die Verknüpfung geändert hat oder entfernt werden soll, werden die entsprechenden Links in der Datenbank aktualisiert.
Zusätzlich werden alle Mitglieder der Gruppe ggf. auch in die Schwestergruppe übernommen.
Parameters:
| Name | Type | Description |
|---|---|---|
req |
ExpressRequestAuthorized | Die aktuelle Express-Request-Instanz (enthält z.B. belongsTo in req.query) |
UID |
Buffer | Die UID der aktuellen Gruppe |
- Source:
Returns:
- Gibt die Schwestergruppe zurück, falls eine neue gesetzt wurde, sonst null
- Type
- Promise.<(object|null)>
(async) initializeRedis() → {Promise.<boolean>}
Initialize the Redis connection after secrets are loaded
- Source:
Returns:
Returns true if initialized successfully, false otherwise
- Type
- Promise.<boolean>
(async) insertAchievement(object, achievementUID, templateUID, session, memberUID, connection) → {Promise.<void>}
import { parseTimestampToSeconds } from '../../utils/parseTimestamp.js'
Inserts a new achievement into the database.
Parameters:
| Name | Type | Description |
|---|---|---|
object |
Object | Achievement object to insert |
achievementUID |
string | Buffer | UUID (hex string or Buffer) of the achievement |
templateUID |
string | Buffer | UUID (hex string or Buffer) of the template |
session |
Object | User session data |
memberUID |
string | Buffer | UUID (hex string or Buffer) of the member |
connection |
Object | Database connection for transaction |
Returns:
- Type
- Promise.<void>
(async) insertFunction() → {Promise.<void>}
Inserts or updates a function template in the database, manages related links and triggers updates.
- Renders a function object from a template and request body.
- Cleans up and compresses access filters to avoid unnecessary filter creation.
- Inserts or updates the function in the ObjectBase table.
- Handles achievement links and triggers requalification or visibility adjustments if needed.
- If the function template changes, rebuilds all jobs based on this template and updates their data.
Parameters:
| Type | Description |
|---|---|
Returns:
- Type
- Promise.<void>
(async) insertOrUpdateAchievement(req, res) → {Promise.<void>}
Handles the insertion or update of an achievement for a member.
This function processes achievement data from the request, checks user authorization,
validates the member and template, and either creates a new achievement or updates an existing one.
It also handles achievement renewal logic and queues necessary updates.
Parameters:
| Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
req |
Object | The request object
Properties
|
||||||||||||||||||||||||||||||||||||||||||||||
res |
Object | The response object |
Throws:
-
- Logs errors with errorLoggerUpdate
- Type
- Error
Returns:
- Sends JSON response with success status and result
- Type
- Promise.<void>
(async) insertOrUpdateJob(req, res) → {Promise.<void>}
Inserts or updates a job in the system.
This function handles the creation of a job for a member in a specific group with a specified function.
It performs several authorization checks and validations before proceeding with the insertion.
Parameters:
| Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
req |
Object | The HTTP request object
Properties
|
||||||||||||||||||||||||||||||||||||||||||||||||||
res |
Object | The HTTP response object |
- Source:
Throws:
-
- Logs errors through errorLoggerUpdate
- Type
- Error
Returns:
- Sends a JSON response with success status and result or error message
- Type
- Promise.<void>
isEmbeddingServerHealthy() → {Promise.<boolean>}
Check if embedding server is healthy
- Source:
Returns:
- Type
- Promise.<boolean>
keyComponents()
Helper function to generate key components for file paths
- Source:
languageUrlGen()
URL generator for language file uploads
- Source:
(async) linkExcludeIntersect(UIDFilter, filtered, target, connection) → {Promise.<void>}
Creates database links for excluded/intersected objects
Parameters:
| Name | Type | Description |
|---|---|---|
UIDFilter |
Buffer | Filter UID |
filtered |
Array.<any> | Filtered objects to exclude/intersect |
target |
Buffer | Target list UID |
connection |
any | Database connection |
Returns:
- Type
- Promise.<void>
(async) linkIncludes(sourceType, UIDFilter, filtered, target, execConnection) → {Promise.<void>}
Creates database links for included objects
Parameters:
| Name | Type | Description |
|---|---|---|
sourceType |
string | Source type ('group' or 'list') |
UIDFilter |
Buffer | Filter UID |
filtered |
Array.<any> | Filtered objects to link |
target |
Buffer | Target list UID |
execConnection |
any | Database connection |
Returns:
- Type
- Promise.<void>
(async) listAchievementsPerson(req, res) → {Promise.<void>}
Fetches achievements associated with a person, joining with template data.
Can return achievements as of a specific point in time.
Can filter to return only unique (latest) achievements.
Parameters:
| Name | Type | Description | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
req |
Object | Express request object.
Properties
|
||||||||||||||||||||||||||||||||||||
res |
Object | Express response object. |
- Source:
Throws:
-
- Logs any errors encountered during database operations.
- Type
- Error
Returns:
- Returns a JSON response with success status and result array.
- Type
- Promise.<void>
loginMailAdd(data, config)
Adds a login email to the `email` array in the provided data object, if applicable.
Parameters:
| Name | Type | Description |
|---|---|---|
data |
Object | The data object containing user information |
config |
Object | Configuration object containing the `LoginMailField` key |
- Source:
mergeCustomizer()
Lodash merge customizer - do not merge arrays
- Source:
(async) migrateAchievementDates() → {Promise.<void>}
Migrates achievements from 05.01.2023 to 01.01.1900
Uses delete and re-insert to handle system versioned table
- Source:
Returns:
- Type
- Promise.<void>
(async) migrateAction(action) → {Promise.<void>}
Handles migration actions for moving objects between different groups or targets.
Supports migration of persons, families, and groups between different organizational units.
Parameters:
| Name | Type | Description |
|---|---|---|
action |
treeAction | The migration action object containing source and target information |
- Source:
Throws:
-
Throws an error if migration is attempted for unsupported object types
- Type
- Error
Returns:
- Type
- Promise.<void>
(async) migrateAction()
- Source:
openAPIMiddleware(baseDir)
Middleware to serve combined OpenAPI documentation
Parameters:
| Name | Type | Description |
|---|---|---|
baseDir |
string | Base directory for resolving references |
- Source:
parseTimestampToSeconds(val) → {number|null}
Parse an incoming query timestamp parameter.
Accepts a number or string (in milliseconds) and returns seconds (number) or null.
Returns null for undefined, null, NaN, or empty string.
Parameters:
| Name | Type | Description |
|---|---|---|
val |
string | number | undefined | null |
- Source:
Returns:
- Type
- number | null
parseTimestampToSecondsOrDefault(val, fallback) → {number}
Parse an incoming timestamp value (milliseconds) and return a seconds value or fallback number.
Parameters:
| Name | Type | Description |
|---|---|---|
val |
string | number | undefined | null | |
fallback |
number | fallback seconds value when val is not present |
- Source:
Returns:
- Type
- number
privateUrlGen()
URL generator for private file uploads
- Source:
(async) processGroupEntry(ObjectFilter, of)
Processes a single filter entry and groups it under the appropriate entry key in the ObjectFilter.
This function organizes filter data by entry UID, creating or updating filter collections
for include, exclude, and intersect filters, along with membership information.
Parameters:
| Name | Type | Description |
|---|---|---|
ObjectFilter |
Record.<string, any> | The object to store grouped filter data, keyed by entry UID |
of |
any | Filter object containing entry data, filter information, and list details |
Throws:
Will log an error if any operation fails during execution.
(async) processIncludeFilter(include, myObjects) → {Promise.<void>}
Processes the inclusion filter and updates the database with the filtered objects.
This function handles the creation of new entries, linking entries to filters, and
processing exclude and intersect filters for newly created entries.
Parameters:
| Name | Type | Description |
|---|---|---|
include |
Object | The inclusion filter object containing filter data and source type. |
myObjects |
Array.<Object> | Array of objects to be filtered and processed. |
Throws:
-
Logs and throws an error if any issue occurs during processing.
- Type
- Error
Returns:
Resolves when the processing is complete.
- Type
- Promise.<void>
Example
const include = {
Data: { filter criteria here },
SourceType: 'group',
listUID: 'someUID',
UID: 'filterUID'
};
const myObjects = [/ array of objects as retrieved by getObjects/];
await processIncludeFilter(include, myObjects);
publicUrlGen()
URL generator for public file uploads
- Source:
(async) queueAdd(root, user, type, UID, UIDBelongsTo, oldTarget, newTarget, timestampopt) → {Promise.<void>}
Adds a single action to the tree queue and triggers queue processing.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
root |
Buffer | string | The UID of the root organization (Buffer or hex string) | ||
user |
Buffer | string | The UID of the user requesting the action | ||
type |
string | The type of action to be performed | ||
UID |
Buffer | string | The UID of the object being acted upon | ||
UIDBelongsTo |
Buffer | string | The UID of the parent object | ||
oldTarget |
Buffer | string | null | The UID of the old target object (for migrations/removals) | ||
newTarget |
Buffer | string | null | The UID of the new target object (for additions/migrations) | ||
timestamp |
number | null |
<optional> |
null | Optional timestamp for the action |
- Source:
Returns:
- Type
- Promise.<void>
(async) queueAddArray(req) → {Promise.<void>}
Adds multiple actions to the tree queue in batch and triggers queue processing.
Parameters:
| Name | Type | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
req |
Object | Express request object with session data
Properties
|
|||||||||||||||
|
- Source:
Returns:
- Type
- Promise.<void>
(async) rebuildFees(UIDfamily, organization) → {Promise.<boolean>}
Rebuilds the fee structure for a given family by UID.
This function fetches all family members, recalculates their fee indices,
updates the fee address if necessary, and persists any changes to the database.
It also publishes relevant events if the fee structure has changed.
This has to be called if a family cahnged, e.g. a new member was added or removed,
Parameters:
| Name | Type | Description |
|---|---|---|
UIDfamily |
Buffer | The UID of the family whose fees are to be rebuilt. |
organization |
string | The organization UID for multi-tenant context. |
- Source:
Throws:
Will log and handle errors internally if any database or processing error occurs.
Returns:
Returns true if the operation was successful, false otherwise.
- Type
- Promise.<boolean>
(async) rebuildFiltersDlist(rebuildFilters, UIDOrga) → {Promise.<Object>}
Rebuilds dynamic list filters and publishes appropriate events for membership changes.
This function removes and re-adds filters within a transaction, then compares the before/after
state to publish add/remove events for affected list members.
Parameters:
| Name | Type | Description |
|---|---|---|
rebuildFilters |
Array | Array of filter objects to rebuild, each containing UIDFilter, UIDList, and Type |
UIDOrga |
string | Buffer | The unique identifier of the organization (required) |
- Source:
Throws:
Will log an error if any operation fails during execution.
Returns:
Result object containing beAdded and removed arrays
- Type
- Promise.<Object>
(async) recreateBanner(UID, banner, bannerRules)
Recreates and propagates banner to child groups and members
Parameters:
| Name | Type | Description |
|---|---|---|
UID |
Buffer | Group UID |
banner |
string | Banner URL/path |
bannerRules |
Object | Banner inheritance rules |
- Source:
(async) recreateJobs(req, jobs, timestamp, requalifyopt)
This function iterates through a list of jobs and updates their corresponding
entries in the ObjectBase database table. It processes job qualification status,
renders objects from templates, and updates various fields including Title,
qualification index, hierarchie, stage, gender
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
req |
Object | The request object containing session information. | ||
jobs |
Array | Array of job objects to be recreated. | ||
timestamp |
number | The timestamp to use for updating objects. | ||
requalify |
boolean |
<optional> |
false | Whether to requalify the jobs. |
- Source:
Throws:
-
Logs error if job recreation fails.
- Type
- Error
(async) recreateJobsPerson(req, res, requalifyopt) → {Promise.<void>}
Retrieves job data for a person at a specific point in time (if timestamp provided),
then recreates the jobs using the recreateJobs function. When requalify is true,
it recalculates job qualification status based on achievements if requalify is true (default).
then recreates the jobs using the recreateJobs function.
Parameters:
| Name | Type | Attributes | Default | Description | |||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
req |
Object | Express request object
Properties
|
|||||||||||||||||||||||||
res |
Object | Express response object | |||||||||||||||||||||||||
requalify |
boolean |
<optional> |
true | Whether to recalculate job qualification status based on achievements |
- Source:
Throws:
-
- Logs error to error logger if query fails
- Type
- Error
Returns:
- Sends JSON response indicating success or handles error
- Type
- Promise.<void>
(async) recreateJobsPerson(req, UIDperson, requalifyopt) → {Promise.<Object>}
Recreates jobs for a specific person based on their UID.
This function fetches job data from the database for a person, potentially as of a specific timestamp,
and then recreates these jobs. It can also requalify the jobs as part of the process.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
req |
Object | The request object containing query parameters. | ||
UIDperson |
string | Buffer | The UID (hex string or Buffer) of the person whose jobs need to be recreated. | ||
requalify |
boolean |
<optional> |
true | Whether to requalify the jobs during recreation. |
- Source:
Throws:
-
- Any errors that occur during the job recreation process are logged.
- Type
- Error
Returns:
- A promise that resolves when the jobs have been recreated.
- Type
- Promise.<Object>
(async) removeAction()
- Source:
(async) removeFilter(req) → {Promise.<Object>}
Remove a specific filter by UID
Parameters:
| Name | Type | Description |
|---|---|---|
req |
ExpressRequestAuthorized | Express request object |
- Source:
Returns:
Result object with success status
- Type
- Promise.<Object>
(async) removeObjects(myDEObjects, exclude, listUID) → {Promise.<(Array.<any>|undefined)>}
Removes objects based on exclude filter criteria
Parameters:
| Name | Type | Description |
|---|---|---|
myDEObjects |
Array.<any> | Array of objects to potentially remove |
exclude |
any | Exclude filter object |
listUID |
any | List identifier |
Returns:
- Array of removed objects
- Type
- Promise.<(Array.<any>|undefined)>
toStringUuid(uuid) → {string}
Helper function to ensure UUIDs are converted to strings
Parameters:
| Name | Type | Description |
|---|---|---|
uuid |
string | Buffer | UUID that might be Buffer or string |
- Source:
Returns:
- UUID as string
- Type
- string
(async) triggerQueue(rootGroup) → {Promise.<void>}
Triggers the processing of the tree queue for a specific root organization.
Processes all queued actions in order and updates the queue status.
Parameters:
| Name | Type | Description |
|---|---|---|
rootGroup |
Buffer | string | The UID of the root organization group (Buffer or hex string) |
- Source:
Returns:
- Type
- Promise.<void>
(async) triggerQueues() → {Promise.<void>}
Initializes action handlers and triggers queue processing for all organizations.
This function imports the action modules and starts queue processing for all root organizations.
- Source:
Returns:
- Type
- Promise.<void>
(async) unExclude(entry, UIDOrga)
Removes the exclusion link for an entry and publishes add events to notify about the re-inclusion.
This function is called when an entry that was previously excluded from a list should now be included.
Parameters:
| Name | Type | Description |
|---|---|---|
entry |
any | Entry object containing UIDEntry, UIDList, UIDBelongsTo |
UIDOrga |
string | The unique identifier of the organization (required) |
Throws:
Will log an error if any operation fails during execution.
(async) updateAchievement(object, achievementUID, templateUID, session, connection) → {Promise.<void>}
Updates an existing achievement in the database.
Parameters:
| Name | Type | Description |
|---|---|---|
object |
Object | Achievement object with updated data |
achievementUID |
string | Buffer | UUID (hex string or Buffer) of the achievement |
templateUID |
string | Buffer | UUID (hex string or Buffer) of the template |
session |
Object | User session data |
connection |
Object | Database connection for transaction |
Returns:
- Type
- Promise.<void>
updateEntityEmbedding(entityUID, data, entityType, organizationUID, optionsopt) → {Promise.<void>}
Updates or creates AI embeddings for any entity type asynchronously
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
entityUID |
Buffer | Entity UID as buffer | ||||||||||||||||
data |
Object | string | Entity data object or pre-prepared text | ||||||||||||||||
entityType |
string | Entity type ('person', 'extern', 'group', etc.) | ||||||||||||||||
organizationUID |
Buffer | Organization UID as buffer | ||||||||||||||||
options |
Object |
<optional> |
Optional configuration
Properties
|
- Source:
Returns:
- Type
- Promise.<void>
(async) updateExistingExtern()
Helper function to update an existing extern member
(async) updateExistingPerson()
Helper function to update an existing person member
- Source:
(async) updateJob(req, res) → {Promise.<void>}
Updates a job after validating user permissions.
The function performs these steps:
1. Converts the job UID parameter to hexadecimal format
2. Checks if the user has admin permissions for the job
3. Validates the job UID exists
4. Retrieves the existing job data from the database
5. Merges the existing job data with the provided updated data
6. Updates the job record in the database
7. Adds the job to an update list for processing
Parameters:
| Name | Type | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
req |
Object | Express request object
Properties
|
|||||||||||||||
res |
Object | Express response object |
- Source:
Throws:
-
- Logs error through errorLoggerUpdate if operation fails
- Type
- Error
Returns:
- Sends JSON response with operation success status
- Type
- Promise.<void>
updatePersonEmbedding(UID, data, Type, UIDOrganization) → {Promise.<void>}
Updates or creates AI embeddings for a person/extern asynchronously
Wrapper around updateEntityEmbedding with sanitize option enabled
Parameters:
| Name | Type | Description |
|---|---|---|
UID |
Buffer | Entity UID as buffer |
data |
Object | Entity data object |
Type |
string | Object type ('person', 'extern', 'group', etc.) |
UIDOrganization |
Buffer | Organization UID as buffer |
- Source:
Returns:
- Type
- Promise.<void>
Type Definitions
AccountItem
Type:
- Object
Properties:
| Name | Type | Attributes | Description |
|---|---|---|---|
type |
string | Account type (e.g., 'family', 'familyFees', 'personal') | |
IBAN |
string |
<optional> |
Bank account IBAN |
- Source:
AddressItem
Type:
- Object
Properties:
| Name | Type | Attributes | Description |
|---|---|---|---|
type |
string | Address type (e.g., 'family', 'personal', 'secondary') | |
road |
string |
<optional> |
Street name |
houseNumber |
string |
<optional> |
House number |
postcode |
string |
<optional> |
Postal code |
countryCode |
string |
<optional> |
Country code |
- Source:
ControllerFunction()
DatabaseObject
Type:
- Object
Properties:
| Name | Type | Attributes | Description |
|---|---|---|---|
UID |
Buffer | The unique identifier as a Buffer | |
UIDBelongsTo |
Buffer | The parent object identifier as a Buffer | |
Type |
string | The object type | |
Title |
string |
<optional> |
Optional title for the object |
DatabaseQueryOptions
Type:
- Object
Properties:
| Name | Type | Attributes | Description |
|---|---|---|---|
log |
boolean |
<optional> |
Whether to log the query |
cast |
Array.<string> |
<optional> |
Fields to cast to JSON |
batch |
boolean |
<optional> |
Whether this is a batch operation |
group |
function |
<optional> |
Grouping function for results |
EmailItem
Type:
- Object
Properties:
| Name | Type | Attributes | Description |
|---|---|---|---|
type |
string | Email type (e.g., 'family', 'personal', 'secondary') | |
email |
string |
<optional> |
Email address |
- Source:
EntryObject
Type:
- Object
Properties:
| Name | Type | Description |
|---|---|---|
UID |
Buffer | Entry unique identifier |
UIDBelongsTo |
Buffer | Parent object identifier |
UIDList |
Buffer | List identifier |
UIDEntry |
Buffer | Entry identifier |
Type |
string | Object type |
Data |
Object | Entry data |
- Source:
ExpressRequest
Type:
- Object
Properties:
| Name | Type | Attributes | Description |
|---|---|---|---|
params |
any |
<optional> |
Route parameters |
query |
any |
<optional> |
Query string parameters |
body |
any |
<optional> |
Request body |
method |
string |
<optional> |
HTTP method |
url |
string |
<optional> |
Request URL |
headers |
any |
<optional> |
Request headers |
user |
any |
<optional> |
Authenticated user object |
session |
SessionData |
<optional> |
Session data |
ExpressRequestAuthorized
Type:
- Object
Properties:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
any |
<optional> |
Route parameters | ||||||||||||||||||||||||||||||||||||
query |
any |
<optional> |
Query string parameters | ||||||||||||||||||||||||||||||||||||
body |
any |
<optional> |
Request body | ||||||||||||||||||||||||||||||||||||
method |
string |
<optional> |
HTTP method | ||||||||||||||||||||||||||||||||||||
url |
string |
<optional> |
Request URL | ||||||||||||||||||||||||||||||||||||
headers |
any |
<optional> |
Request headers | ||||||||||||||||||||||||||||||||||||
user |
Object |
<optional> |
Authenticated user object | ||||||||||||||||||||||||||||||||||||
session |
Object | Session data (guaranteed to exist for authorized requests)
Properties
|
ExpressResponse
Type:
- Object
Properties:
| Name | Type | Description |
|---|---|---|
status |
function | Set status code |
json |
function | Send JSON response |
send |
function | Send response |
set |
function | Set header |
end |
function | End response |
FamilyMemberObject
Type:
- Object
Properties:
| Name | Type | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
UID |
Buffer | Member unique identifier | ||||||||||||||||||||
Type |
'person' | 'extern' | 'family' | Object type (required) | ||||||||||||||||||||
Data |
Object | Member data object (required)
Properties
|
- Source:
FilterAction
Type:
- 'visible' | 'changeable' | 'include' | 'exclude' | 'intersect'
FilterData
Type:
- Object
Properties:
| Name | Type | Attributes | Description |
|---|---|---|---|
UID |
string | Filter unique identifier | |
Type |
string | Filter type (include, exclude, intersect) | |
Data |
any | Filter configuration | |
SourceType |
string |
<optional> |
Source type (group, list, etc.) |
listUID |
string |
<optional> |
Associated list UID |
FilterObject
Type:
- Object
Properties:
| Name | Type | Description |
|---|---|---|
UID |
Buffer | The filter unique identifier |
Type |
string | Filter type ('include', 'exclude', 'intersect') |
Data |
Object | Filter configuration data |
FilterOptions
Type:
- Object
Properties:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
virtual |
boolean |
<optional> |
false | Whether this is a virtual operation (no permanent changes) |
connection |
any |
<optional> |
null | Database connection for transactions |
MemberData
Type:
- Object
Properties:
| Name | Type | Attributes | Description |
|---|---|---|---|
UID |
Buffer | string | Member unique identifier | |
UIDBelongsTo |
Buffer | string | Parent object identifier | |
Type |
string | Object type | |
Data |
any | Member data | |
Title |
string |
<optional> |
Optional title |
new |
boolean |
<optional> |
Whether this is a new entry |
OrganizationData
Type:
- Object
Properties:
| Name | Type | Attributes | Description |
|---|---|---|---|
UID |
string | Organization unique identifier | |
name |
string | Organization name | |
data |
any |
<optional> |
Additional organization data |
PhoneItem
Type:
- Object
Properties:
| Name | Type | Attributes | Description |
|---|---|---|---|
type |
string | Phone type (e.g., 'family', 'personal', 'secondary') | |
number |
string |
<optional> |
Phone number |
- Source:
PublishEventOptions
Type:
- Object
Properties:
| Name | Type | Attributes | Description |
|---|---|---|---|
organization |
string | The organization UUID for multi-tenant scoping | |
data |
Array.<any> | any | The event data payload | |
backDate |
number |
<optional> |
Unix timestamp for backdated events |
- Source:
ServiceResult
Type:
- Object
Properties:
| Name | Type | Attributes | Description |
|---|---|---|---|
success |
boolean | Whether the operation was successful | |
result |
any |
<optional> |
Result data if successful |
error |
any |
<optional> |
Error message if unsuccessful |
UIDaction |
string |
<optional> |
Action UID for some operations |
SessionData
Type:
- Object
Properties:
| Name | Type | Attributes | Description |
|---|---|---|---|
root |
string |
<optional> |
The root organization UUID |
user |
string |
<optional> |
The database member UUID |
baseUser |
string |
<optional> |
The base user UUID |
loginOrga |
string |
<optional> |
The login organization UUID from token |
sysUser |
string |
<optional> |
System user UID (often used as organization/system admin) |
authUser |
any |
<optional> |
Authenticated user from bearer token (groups, orgRoles, etc.) |
save |
function | Save session data | |
destroy |
function | Destroy session | |
regenerate |
function | Regenerate session ID | |
reload |
function | Reload session data |
SocketIOServer
Socket.IO server instance
Type:
- Object
- Source:
SocketIOSocket
Socket.IO socket connection
Type:
- Object
Properties:
| Name | Type | Description |
|---|---|---|
request |
Object | HTTP request object |
data |
Object | Socket data storage |
id |
string | Socket connection ID |
connected |
boolean | Whether socket is connected |
emit |
function | Emit event to socket |
disconnect |
function | Disconnect socket |
- Source:
treeAction
The action object containing details about the operation to be performed.
Type:
- Object