UNPKG

@sinch/mcp

Version:

Sinch MCP server

53 lines (48 loc) 2.33 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.renderInstructions = exports.formatChannelSpecificTemplates = exports.formatOmniChannelTemplates = exports.formatListAllTemplatesResponse = void 0; const formatListAllTemplatesResponse = (data) => { return (data.templates ?? []).map((template) => ({ id: template.id, description: template.description, version: template.version, defaultTranslation: template.default_translation, translations: template.translations?.map((t) => `${t.language_code} (version "${t.version}")`), })); }; exports.formatListAllTemplatesResponse = formatListAllTemplatesResponse; const formatOmniChannelTemplates = (responseUS, responseEU, responseBR) => { return [ `List of omni-channels templates in the US region: ${JSON.stringify((0, exports.formatListAllTemplatesResponse)(responseUS))}`, `List of omni-channels templates in the EU region: ${JSON.stringify((0, exports.formatListAllTemplatesResponse)(responseEU))}`, `List of omni-channels templates in the BR region: ${JSON.stringify((0, exports.formatListAllTemplatesResponse)(responseBR))}`, ].join('\n'); }; exports.formatOmniChannelTemplates = formatOmniChannelTemplates; const formatChannelSpecificTemplates = (templates) => { return `List of WhatsApp templates: ${JSON.stringify(templates)}`; }; exports.formatChannelSpecificTemplates = formatChannelSpecificTemplates; exports.renderInstructions = ` Please return the data in a structured array format with each item on a separate line. One array for omni-channel templates and another for channel-specific templates. For the omni-channel templates, just display: - Id - Description - Version - Default translation - List of translations as pairs of (language_code / version) Example: | ID | Description | Version | Default translation | Translations | | 0123 | My template desc | 1 | en-US | en-US(latest), en-US(1) | For the WhatsApp templates (called channel-specific), just display: - Channel - Name - Language - Category - State Example: | Channel | Name | Language | Category | State | | WhatsApp | wa_template | en-US | Marketing | Approved | `; //# sourceMappingURL=format-list-all-templates-response.js.map