UNPKG

@sinch/mcp

Version:

Sinch MCP server

89 lines 3.47 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const format_list_all_apps_response_1 = require("../../../../src/tools/conversation/utils/format-list-all-apps-response"); describe('formatListAllAppsResponse', () => { it('formats a list of apps with channel credentials', () => { const input = { 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 = (0, format_list_all_apps_response_1.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 = {}; const output = (0, format_list_all_apps_response_1.formatListAllAppsResponse)(input); expect(output).toEqual({ apps: [] }); }); }); //# sourceMappingURL=format-list-all-apps-response.test.js.map