Skip to main content
Glama
KintoneCredentials.js1.23 kB
// src/models/KintoneCredentials.js function normalizeDomain(rawDomain) { if (!rawDomain || typeof rawDomain !== 'string') { throw new Error('KINTONE_DOMAIN が不正です。文字列を指定してください。'); } const trimmed = rawDomain.trim(); const prefixed = trimmed.startsWith('http://') || trimmed.startsWith('https://') ? trimmed : `https://${trimmed}`; let url; try { url = new URL(prefixed); } catch (error) { throw new Error('KINTONE_DOMAIN がURLとして解釈できません。http(s)://を含めた形式か、サブドメインのみを指定してください。'); } return { host: url.host, // 例: your-subdomain.cybozu.com や localhost:8000 origin: `${url.protocol}//${url.host}` // 例: https://your-subdomain.cybozu.com }; } export class KintoneCredentials { constructor(domain, username, password) { const normalized = normalizeDomain(domain); this.domain = normalized.host; this.origin = normalized.origin; this.username = username; this.password = password; this.auth = Buffer.from(`${username}:${password}`).toString('base64'); } }

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/r3-yamauchi/kintone-mcp-server'

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