Skip to main content
Glama
mappers.ts1.61 kB
import type { KeysetConfig } from "../types"; import type { KeysetProperties } from "./types"; function assignMessagePersistenceProps(config: KeysetConfig, properties: KeysetProperties): void { if (!config.messagePersistence) return; properties.history = config.messagePersistence.enabled; if (config.messagePersistence.retention !== undefined) { properties.message_storage_ttl = config.messagePersistence.retention; } } function assignAppContextProps(config: KeysetConfig, properties: KeysetProperties): void { if (!config.appContext) return; properties.objects = config.appContext.enabled; if (config.appContext.region !== undefined) { properties.objects_region = config.appContext.region; } } function assignFilesProps(config: KeysetConfig, properties: KeysetProperties): void { if (!config.files) return; properties.files_enabled = config.files.enabled; if (config.files.region !== undefined) { properties.files_s3_bucket_region = config.files.region; } if (config.files.retention !== undefined) { properties.files_ttl_in_days = config.files.retention; } } function assignPresenceProps(config: KeysetConfig, properties: KeysetProperties): void { if (!config.presence) return; properties.presence = config.presence.enabled; } export function toProperties(config: KeysetConfig): KeysetProperties { const properties: KeysetProperties = {}; assignMessagePersistenceProps(config, properties); assignAppContextProps(config, properties); assignFilesProps(config, properties); assignPresenceProps(config, properties); return properties; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pubnub/pubnub-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server