Skip to main content
Glama
by sinch
format-list-all-apps-response.test.ts2.48 kB
import { Conversation } from '@sinch/sdk-core'; import { formatListAllAppsResponse } from '../../../../src/tools/conversation/utils/format-list-all-apps-response'; describe('formatListAllAppsResponse', () => { it('formats a list of apps with channel credentials', () => { const input: Conversation.ListAppsResponse = { apps: [ { id: 'app1', display_name: 'App One', channel_credentials: [ { channel: 'MESSENGER', static_token: { token: 'zyxwvutsrqponmlkjihgfedcba', }, callback_secret: 'secret1', state: { status: 'ACTIVE', description: '' }, channel_known_id: '12345', }, { channel: 'TELEGRAM', telegram_credentials: { token: 'token2' }, callback_secret: 'secret2', state: { status: 'ACTIVE', description: '' }, channel_known_id: '', }, { channel: 'RCS', static_bearer: { claimed_identity: 'oaSdk5smdGnbdh', token: 'abcdef1234567890', }, callback_secret: '', state: { status: 'FAILING', description: '' }, channel_known_id: '', } ], conversation_metadata_report_view: 'NONE', rate_limits: { outbound: 80, inbound: 100, webhooks: 100 } }, { id: 'app2', display_name: 'App Two', channel_credentials: [] } ] }; const output = formatListAllAppsResponse(input); expect(output).toEqual({ apps: [ { id: 'app1', display_name: 'App One', channel_credentials: [ { channel: 'MESSENGER' }, { channel: 'TELEGRAM' } ] }, { id: 'app2', display_name: 'App Two', channel_credentials: [] } ] }); }); it('returns empty apps array when input has no apps', () => { const input: Conversation.ListAppsResponse = {}; const output = formatListAllAppsResponse(input); expect(output).toEqual({ apps: [] }); }); });

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/sinch/sinch-mcp-server'

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