Get a specific limetype by name.
Retrieves the LimeType definition for the specified limetype name.
Returns undefined if the limetype does not exist or has not been loaded.
Common limetype names include: 'company', 'person', 'deal', 'todo', 'helpdesk', but the available types depend on your Lime CRM configuration.
Internal name of the limetype (e.g., 'deal', 'company', 'person')
The LimeType definition, or undefined if not found
import { PlatformServiceName } from '@limetech/lime-web-components';
const repository = platform.get(PlatformServiceName.LimeTypeRepository);
const dealType = repository.getLimeType('deal');
if (dealType) {
console.log('Deal type:', dealType.localname.singular);
console.log('Can create deals:', dealType.acl.create);
}
Get all loaded limetypes.
Returns an array of all LimeType definitions currently loaded in the repository state. This typically includes all limetypes that the current user has access to in the Lime CRM system.
The returned array may be empty if limetypes have not been loaded yet. Limetypes are usually loaded automatically during platform initialization.
Array of LimeType definitions (may be empty)
import { PlatformServiceName } from '@limetech/lime-web-components';
const repository = platform.get(PlatformServiceName.LimeTypeRepository);
const types = repository.getLimeTypes();
const creatableTypes = types.filter((limetype) => limetype.acl.create);
Subscribe to state changes with optional transformation and filtering.
The subscription will immediately invoke the callback with the current state (if any), then continue to call it whenever the state changes. The map and filter options allow you to transform and selectively receive updates.
Function called with state updates (after map/filter applied)
Optionaloptions: StateOptionsOptional transformations and filters for the subscription
Unsubscribe function - call this to stop receiving updates
import { PlatformServiceName } from '@limetech/lime-web-components';
const repository = platform.get(PlatformServiceName.Application);
const logger = platform
.get(PlatformServiceName.Logger)
.createLogger('my-component');
// Basic subscription
const unsubscribeState = repository.subscribe((state) => {
logger.debug('State updated', { state });
});
// With transformations
const unsubscribeUserName = repository.subscribe(
(userName) => logger.debug('User', { userName }),
{ map: [(state) => state.currentUser?.fullname] }
);
Repository for accessing limetype metadata and schema information.
LimeTypeRepository provides access to limetype definitions that describe the structure, properties, and access controls for business object types in Lime CRM. Each LimeType contains:
The repository extends StateRepository, enabling:
RECOMMENDED: Use SelectCurrentLimeType decorator to automatically get the limetype for the current context. This is more convenient than manual repository access and ensures your component reacts to context changes.
Each method below carries its own example.
See