Abstract Private _Private _cachedPrivate _latestPrivate _latestPrivate _localProtected _preResult from PreRunQueries hook containing cache status for batch operations
Optional cacheOptional cachedOptional telemetryOptional uncachedProtected _preResult from PreRunQuery hook containing cache status and optional cached result
Optional cachedOptional fingerprint?: stringOptional telemetryProtected _preResult from PreRunView hook containing cache status and optional cached result
Optional cachedOptional fingerprint?: stringOptional telemetryProtected _preResult from PreRunViews hook containing cache status for batch operations
Optional cacheOptional cachedOptional smartWhen CacheLocal is enabled, contains the cache check params to send to server
Optional telemetryOptional uncachedOptional useWhen CacheLocal is enabled, indicates we should use smart cache check
Private _refreshProtected Static _mjPrivate Static localPrivate Static localPrivate Static localPrivate Static localGets all explorer navigation items including inactive ones.
Array of all ExplorerNavigationItem objects
Returns the currently loaded local metadata from within the instance
Protected Abstract AllowDetermines if a refresh is currently allowed or not. Subclasses should return FALSE if they are performing operations that should prevent refreshes. This helps avoid metadata refreshes during critical operations.
Gets all application metadata in the system.
Array of ApplicationInfo objects representing all applications
Gets all audit log types defined for tracking system activities.
Array of AuditLogTypeInfo objects
Gets all authorization definitions in the system.
Array of AuthorizationInfo objects defining permissions
Gets the configuration data that was provided to the provider.
The provider configuration including schema filters
Abstract DatabaseFor providers that have ProviderType==='Database', this property will return an object that represents the underlying database connection. For providers where ProviderType==='Network' this property will throw an exception. The type of object returned is provider-specific (e.g., SQL connection pool).
Gets all entity metadata in the system.
Array of EntityInfo objects representing all entities
Abstract InstanceThis property is implemented by each sub-class of ProviderBase and is intended to return a unique string that identifies the instance of the provider for the connection it is making. For example: for network connections, the URL including a TCP port would be a good connection string, whereas on database connections the database host url/instance/port would be a good connection string. This is used as part of cache keys to ensure different connections don't share cached data.
Gets the latest metadata timestamps from local cache. Used for comparison with remote timestamps.
Array of locally cached metadata timestamps
Gets the latest metadata timestamps from the remote server. Used to determine if local cache is out of date.
Array of metadata timestamp information
Gets all library definitions in the system.
Array of LibraryInfo objects representing code libraries
Protected LocalThis property will return the prefix to use for local storage keys. This is useful if you have multiple instances of a provider running in the same environment and you want to keep their local storage keys separate. The default implementation returns an empty string, but subclasses can override this to return a unique string based on the connection or other distinct identifier.
Abstract LocalGets the local storage provider implementation. Must be implemented by subclasses to provide environment-specific storage.
Local storage provider instance
Protected Abstract MetadataGets the metadata provider instance. Must be implemented by subclasses to provide access to metadata.
The metadata provider instance
Protected PreOptional cacheOptional cachedOptional telemetryOptional uncachedProtected PreOptional cachedOptional fingerprint?: stringOptional telemetryProtected PreOptional cachedOptional fingerprint?: stringOptional telemetryProtected PreOptional cacheOptional cachedOptional smartWhen CacheLocal is enabled, contains the cache check params to send to server
Optional telemetryOptional uncachedOptional useWhen CacheLocal is enabled, indicates we should use smart cache check
Abstract ProviderReturns the provider type for the instance. Identifies whether this is a Database or Network provider.
Gets all query category definitions.
Array of QueryCategoryInfo objects for query organization
Gets all query entity associations.
Array of QueryEntityInfo objects linking queries to entities
Gets all query field definitions.
Array of QueryFieldInfo objects defining query result columns
Gets all query parameter definitions.
Array of QueryParameterInfo objects for parameterized queries
Gets all query permission assignments.
Array of QueryPermissionInfo objects defining query access
Gets all row-level security filters defined in the system.
Array of RowLevelSecurityFilterInfo objects for data access control
Gets only active explorer navigation items sorted by sequence. Results are cached for performance.
Array of active ExplorerNavigationItem objects
Protected BuildBuilds dataset filters based on the provider configuration. Ensures MJ Core schema is always included and never excluded.
Array of filters to apply when loading metadata
Stores a dataset in the local cache. If itemFilters are provided, the combination of datasetName and the filters are used to build a key and determine a match in the cache
Checks if local metadata is out of date and needs refreshing. Compares local timestamps with server timestamps.
Optional providerToUse: IMetadataProviderTrue if refresh is needed, false otherwise
If the specified datasetName is cached, this method will clear the cache. If itemFilters are provided, the combination of datasetName and the filters are used to determine a match in the cache
Optional itemFilters: DatasetItemFilterType[]Protected CloneConfigures the provider with the specified configuration data. Handles metadata refresh if needed and initializes the provider.
Configuration including schema filters and connection info
Optional providerToUse: IMetadataProviderTrue if configuration was successful
Protected ConvertConverts dataset item filters into a unique string key for caching.
Array of filters to convert
JSON-formatted string representing the filters
Protected CopyAbstract CreateCreates a new transaction group for managing database transactions. Must be implemented by subclasses to provide transaction support.
A new transaction group instance
Protected EntityUsed to check to see if the entity in question is active or not If it is not active, it will throw an exception or log a warning depending on the status of the entity being either Deprecated or Disabled.
Protected GetRetrieves all metadata from the server and constructs typed instances. Uses the MJ_Metadata dataset for efficient bulk loading.
Optional providerToUse: IMetadataProviderComplete metadata collection with all relationships
Gets a database by name, if required, and caches it in a format available to the client (e.g. IndexedDB, LocalStorage, File, etc). The cache method is Provider specific If itemFilters are provided, the combination of datasetName and the filters are used to determine a match in the cache
Optional itemFilters: DatasetItemFilterType[]Optional contextUser: UserInfoOptional providerToUse: IMetadataProviderThis routine gets the local cached version of a given datasetName/itemFilters combination, it does NOT check the server status first and does not fall back on the server if there isn't a local cache version of this dataset/itemFilters combination
Optional itemFilters: DatasetItemFilterType[]Protected Abstract GetAbstract GetAlways retrieves data from the server - this method does NOT check cache. To use cached local values if available, call GetAndCacheDatasetByName() instead
Optional itemFilters: DatasetItemFilterType[]Optional contextUser: UserInfoOptional providerToUse: IMetadataProviderCreates a unique key for the given datasetName and itemFilters combination coupled with the instance connection string to ensure uniqueness when 2+ connections exist
Optional itemFilters: DatasetItemFilterType[]Abstract GetRetrieves the date status information for a dataset and all its items from the server. This method will match the datasetName and itemFilters to the server's dataset and item filters to determine a match
Optional itemFilters: DatasetItemFilterType[]Optional contextUser: UserInfoOptional providerToUse: IMetadataProviderReturns a list of entity dependencies, basically metadata that tells you the links to this entity from all other entities.
Creates a new instance of a BaseEntity subclass for the specified entity and automatically calls NewRecord() to initialize it. This method serves as the core implementation for entity instantiation in the MemberJunction framework.
The name of the entity to create (must exist in metadata)
Optional contextUser: UserInfoOptional user context for permissions and audit tracking
Promise resolving to the newly created entity instance with NewRecord() called
Error if entity name is not found in metadata or if instantiation fails
Creates a new instance of a BaseEntity subclass and loads an existing record using the provided key. This overload provides a convenient way to instantiate and load in a single operation.
The name of the entity to create (must exist in metadata)
CompositeKey containing the primary key value(s) for the record to load
Optional contextUser: UserInfoOptional user context for permissions and audit tracking
Promise resolving to the entity instance with the specified record loaded
Error if entity name is not found, instantiation fails, or record cannot be loaded
Abstract GetGets the display name for a single entity record. Uses the entity's IsNameField or falls back to 'Name' field if available.
The name of the entity
The primary key value(s) for the record
Optional contextUser: UserInfoOptional user context for permissions
The display name of the record or null if not found
Abstract GetGets display names for multiple entity records in a single operation. More efficient than multiple GetEntityRecordName calls.
Array of entity/key pairs to lookup
Optional contextUser: UserInfoOptional user context for permissions
Array of results with names and status for each requested record
Protected GetRetrieves the latest metadata update timestamps from the server.
Optional providerToUse: IMetadataProviderArray of metadata update information
Returns the timestamp of the local cached version of a given datasetName or null if there is no local cache for the specified dataset
the name of the dataset to check
Optional itemFilters: DatasetItemFilterType[]optional filters to apply to the dataset
Abstract GetReturns a list of dependencies - records that are linked to the specified Entity/RecordID combination. A dependency is as defined by the relationships in the database. The MemberJunction metadata that is used for this simply reflects the foreign key relationships that exist in the database. The CodeGen tool is what detects all of the relationships and generates the metadata that is used by MemberJunction. The metadata in question is within the EntityField table and specifically the RelatedEntity and RelatedEntityField columns. In turn, this method uses that metadata and queries the database to determine the dependencies. To get the list of entity dependencies you can use the utility method GetEntityDependencies(), which doesn't check for dependencies on a specific record, but rather gets the metadata in one shot that can be used for dependency checking.
the name of the entity to check
Optional contextUser: UserInfoAbstract GetReturns a list of record IDs that are possible duplicates of the specified record.
object containing many properties used in fetching records and determining which ones to return
Optional contextUser: UserInfoAbstract GetChecks if a specific record is marked as a favorite by the user.
The ID of the user to check
The name of the entity
The primary key value(s) for the record
Optional contextUser: UserInfoOptional user context for permissions
True if the record is a favorite, false otherwise
Protected Abstract InternalInternal implementation of RunQueries that subclasses must provide. This method should ONLY contain the batch query execution logic - no pre/post processing. The base class handles all orchestration (telemetry, caching).
Array of query parameters
Optional contextUser: UserInfoOptional user context for permissions
Protected Abstract InternalInternal implementation of RunQuery that subclasses must provide. This method should ONLY contain the query execution logic - no pre/post processing. The base class handles all orchestration (telemetry, caching).
The query parameters
Optional contextUser: UserInfoOptional user context for permissions
Protected Abstract InternalInternal implementation of RunView that subclasses must provide. This method should ONLY contain the data fetching logic - no pre/post processing. The base class handles all orchestration (telemetry, caching, transformation).
The view parameters
Optional contextUser: UserInfoOptional user context for permissions
Protected Abstract InternalInternal implementation of RunViews that subclasses must provide. This method should ONLY contain the batch data fetching logic - no pre/post processing. The base class handles all orchestration (telemetry, caching, transformation).
Array of view parameters
Optional contextUser: UserInfoOptional user context for permissions
This routine checks to see if the local cache version of a given datasetName/itemFilters combination is up to date with the server or not
Optional itemFilters: DatasetItemFilterType[]Determines if a given datasetName/itemFilters combination is cached locally or not
Optional itemFilters: DatasetItemFilterType[]Protected LoadAbstract MergeThis method will merge two or more records based on the request provided. The RecordMergeRequest type you pass in specifies the record that will survive the merge, the records to merge into the surviving record, and an optional field map that can update values in the surviving record, if desired. The process followed is:
The return value from this method contains detailed information about the execution of the process. In addition, all attempted merges are logged in the RecordMergeLog and RecordMergeDeletionLog tables.
Optional contextUser: UserInfoOptional options: EntityMergeOptionsProtected PostPost-processes entity metadata to establish relationships between entities and their child objects. Links fields, permissions, relationships, and settings to their parent entities.
Array of entity metadata
Array of entity field metadata
Array of entity field value metadata
Array of entity permission metadata
Array of entity relationship metadata
Array of entity settings metadata
Processed array of EntityInfo instances with all relationships established
Protected PostBase class post-processor that all sub-classes should call after they finish their RunView process
Optional contextUser: UserInfoProtected PostBase class utilty method that should be called after each sub-class handles its internal RunViews() process before returning results This handles the optional conversion of simple objects to entity objects for each requested view depending on if the params requests a result_type === 'entity_object'
Optional contextUser: UserInfoProtected PostPost-processing hook for RunQueries (batch). Handles telemetry end.
Array of query results
Array of query parameters
The pre-processing result
Optional cacheOptional cachedOptional telemetryOptional uncachedOptional contextUser: UserInfoOptional user context
Protected PostPost-processing hook for RunQuery. Handles cache storage and telemetry end.
The query result
The query parameters
The pre-processing result
Optional cachedOptional fingerprint?: stringOptional telemetryOptional contextUser: UserInfoOptional user context
Protected PostPost-processing hook for RunView. Handles result transformation, cache storage, and telemetry end.
The view result
The view parameters
The pre-processing result
Optional cachedOptional fingerprint?: stringOptional telemetryOptional contextUser: UserInfoOptional user context
Protected PostPost-processing hook for RunViews (batch). Handles result transformation, cache storage, and telemetry end.
Array of view results
Array of view parameters
The pre-processing result
Optional cacheOptional cachedOptional smartWhen CacheLocal is enabled, contains the cache check params to send to server
Optional telemetryOptional uncachedOptional useWhen CacheLocal is enabled, indicates we should use smart cache check
Optional contextUser: UserInfoOptional user context
Protected PreOptional contextUser: UserInfoUse PreRunView instead. This method is kept for backward compatibility.
Protected PreBase class implementation for handling pre-processing of RunViews() each sub-class should call this within their RunViews() method implementation
Optional contextUser: UserInfoProtected PrePre-processing hook for RunQueries (batch). Handles telemetry for batch query operations.
Array of query parameters
Optional contextUser: UserInfoOptional user context
Pre-processing result
Protected PrePre-processing hook for RunQuery. Handles telemetry and cache lookup.
The query parameters
Optional contextUser: UserInfoOptional user context
Pre-processing result with cache status and optional cached result
Protected PrePre-processing hook for RunView. Handles telemetry, validation, entity status check, and cache lookup.
The view parameters
Optional contextUser: UserInfoOptional user context
Pre-processing result with cache status and optional cached result
Protected PrePre-processing hook for RunViews (batch). Handles telemetry, validation, and cache lookup for multiple views.
Array of view parameters
Optional contextUser: UserInfoOptional user context
Pre-processing result with cache status for each view
Refreshes all metadata from the server. Respects the AllowRefresh flag from subclasses.
Optional providerToUse: IMetadataProviderTrue if refresh was initiated or allowed
Refreshes metadata only if needed based on timestamp comparison. Combines check and refresh into a single operation.
Optional providerToUse: IMetadataProviderTrue if refresh was successful or not needed
Refreshes the remote metadata timestamps from the server. Updates the internal cache of remote timestamps.
Optional providerToUse: IMetadataProviderTrue if timestamps were successfully refreshed
Runs multiple queries based on the provided parameters. This method orchestrates the full execution flow for batch query operations.
Array of query parameters
Optional contextUser: UserInfoOptional user context for permissions (required server-side)
Array of query results
Runs a query based on the provided parameters. This method orchestrates the full execution flow: pre-processing, cache check, internal execution, post-processing, and cache storage.
The query parameters
Optional contextUser: UserInfoOptional user context for permissions (required server-side)
The query results
Runs a view based on the provided parameters. This method orchestrates the full execution flow: pre-processing, cache check, internal execution, post-processing, and cache storage.
The view parameters
Optional contextUser: UserInfoOptional user context for permissions (required server-side)
The view results
Runs multiple views based on the provided parameters. This method orchestrates the full execution flow for batch operations.
Array of view parameters
Optional contextUser: UserInfoOptional user context for permissions (required server-side)
Array of view results
Abstract SetSets or removes a record's favorite status for a user.
The ID of the user
The name of the entity
The primary key value(s) for the record
True to mark as favorite, false to remove
User context for permissions (required)
Protected TransformTransforms the result set from simple objects to entity objects if needed.
The RunViewParams used for the request
The RunViewResult returned from the request
Optional contextUser: UserInfoThe user context for permissions
Protected UpdateUpdates the local metadata cache with new data.
The new metadata to store locally
Private executeExecutes the smart cache check flow for RunViews. Calls RunViewsWithCacheCheck on the provider (if available) and processes the results, using cached data for 'current' items and fresh data for 'stale' items.
Optimized to process all results in parallel using Promise.all for cache lookups, cache updates, and entity transformations.
Optional cacheOptional cachedOptional smartWhen CacheLocal is enabled, contains the cache check params to send to server
Optional telemetryOptional uncachedOptional useWhen CacheLocal is enabled, indicates we should use smart cache check
Optional contextUser: UserInfoProtected extractExtracts the maximum __mj_UpdatedAt timestamp from a set of results. This is used for cache freshness checking.
Array of result objects that may contain __mj_UpdatedAt
ISO string of the max timestamp, or current time if none found
Protected mergeMerges cached and fresh results for RunViews, maintaining original order.
The pre-processing result with cache info
Optional cacheOptional cachedOptional smartWhen CacheLocal is enabled, contains the cache check params to send to server
Optional telemetryOptional uncachedOptional useWhen CacheLocal is enabled, indicates we should use smart cache check
The fresh results from InternalRunViews
Combined results in original order
Protected mergeMerges cached and fresh results for RunQueries, maintaining original order.
The pre-processing result with cache info
Optional cacheOptional cachedOptional telemetryOptional uncachedThe fresh results from InternalRunQueries
Combined results in original order
Private preparePrepares smart cache check parameters for RunViews when CacheLocal is enabled. Instead of returning cached data immediately, this builds params to send to the server which will validate if the cache is current or return fresh data.
Optional contextUser: UserInfoPrivate processProcesses a single smart cache check result. Handles cache lookup for 'current' items and cache update for 'stale' items.
Optional contextUser: UserInfo
Base class for all metadata providers in MemberJunction. Implements common functionality for metadata caching, refresh, and dataset management. Subclasses must implement abstract methods for provider-specific operations.