Files
confluence-mcp/node_modules/hono/dist/utils/encode.js
Christian Gick 2768650b42 feat: Initial confluence-mcp server for realtime collaboration
Provides 8 MCP tools for Confluence Cloud:
- confluence_list_spaces, confluence_create_space
- confluence_search, confluence_get_page
- confluence_create_page, confluence_update_page
- confluence_get_comments, confluence_add_comment

Uses Confluence REST API v2 with basic auth.
Registered in Claude Code and mcp-proxy.

Refs: CF-935

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 18:09:30 +02:00

30 lines
864 B
JavaScript

// src/utils/encode.ts
var decodeBase64Url = (str) => {
return decodeBase64(str.replace(/_|-/g, (m) => ({ _: "/", "-": "+" })[m] ?? m));
};
var encodeBase64Url = (buf) => encodeBase64(buf).replace(/\/|\+/g, (m) => ({ "/": "_", "+": "-" })[m] ?? m);
var encodeBase64 = (buf) => {
let binary = "";
const bytes = new Uint8Array(buf);
for (let i = 0, len = bytes.length; i < len; i++) {
binary += String.fromCharCode(bytes[i]);
}
return btoa(binary);
};
var decodeBase64 = (str) => {
const binary = atob(str);
const bytes = new Uint8Array(new ArrayBuffer(binary.length));
const half = binary.length / 2;
for (let i = 0, j = binary.length - 1; i <= half; i++, j--) {
bytes[i] = binary.charCodeAt(i);
bytes[j] = binary.charCodeAt(j);
}
return bytes;
};
export {
decodeBase64,
decodeBase64Url,
encodeBase64,
encodeBase64Url
};